Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Cristiang1021/ErgoKawsay/llms.txt

Use this file to discover all available pages before exploring further.

Reading about ergonomics is valuable — watching it is even more effective. ErgoKawsay’s Videos module (Aprendizaje / Alli Kawsay Yachachiy Rimaykuna) provides short, focused educational videos that demonstrate the correct posture techniques and physical practices described elsewhere in the app. Each video is bundled directly inside the application — no links to YouTube, no streaming, no internet required. The module presents each video as a large cinema-style card designed to invite engagement: a bold color theme, a centered play button, and the video title and description overlaid at the bottom. Tapping anywhere on the card launches the in-app video player.

Available Videos

IDTitle (ES)Title (Kichwa)Asset
ergo_postureErgonomía para docentes: postura correctaYachachikpak allillamkayachay: Alli shayana, tiyarinapash.assets/videos/Ergonomia_Postura_correcta.mp4
yoga_10Yoga de 7 minutos: relajación docenteUkku, huma, samay tantachiyta (yoga) yachachik 7 chinikupi alli kana.assets/videos/5_MINUTOS_DE_YOGA.mp4
The two videos correspond to different well-being categories, reflected in their visual themes:
VideoCategory badgeBackground colorIcon
ergo_postureCUERPOblockLilacIcons.airline_seat_recline_extra_rounded
yoga_10BIENESTARblockMintIcons.self_improvement_rounded

Video Player

Package: video_player ^2.9.2 Tapping a video card launches VideoPlayerScreen, a dedicated full-featured player built on top of the video_player package. The player supports both portrait and landscape/fullscreen modes.

Portrait Mode

The video renders in its native aspect ratio, clipped with rounded corners inside a padded frame. Below the video:
  • A seek slider with current position and total duration labels
  • A fullscreen button (Icons.fullscreen_rounded) to enter landscape mode
Tapping the video area shows or hides the overlay controls. Controls auto-hide after 3 seconds when the video is playing.

Fullscreen (Landscape) Mode

Tapping the fullscreen button:
  1. Rotates the device to landscape (landscapeLeft + landscapeRight)
  2. Enters SystemUiMode.immersive (hides status and navigation bars)
  3. Renders the video edge-to-edge with a semi-transparent control overlay
The fullscreen overlay includes the video title, a centered play/pause button, a seek slider, and an exit-fullscreen button. Exiting fullscreen restores portrait orientation and system UI automatically.

Playlist Navigation

When multiple videos are available, prev/next buttons appear below the video in portrait mode, along with a counter chip (e.g., 1 / 2). Videos are navigated in the order defined by LocalDataRepository.instance.videos.

Error Handling

If a video asset fails to load or initialize, the player area is replaced by an error card showing the video title and a localized message (“No se pudo cargar el video” / “Videoqa manaraq chaninchasqachu”).
All videos are bundled as Flutter asset files and played directly from local storage. There is no streaming — playback works fully offline with no network connection required.

Asset Declaration

All video files must be declared in pubspec.yaml:
flutter:
  assets:
    - assets/videos/Ergonomia_Postura_correcta.mp4
    - assets/videos/5_MINUTOS_DE_YOGA.mp4
The VideoPlayerController is initialized with VideoPlayerController.asset(path) when assetPath is set on the VideoItem. If a url is provided instead, VideoPlayerController.networkUrl(Uri.parse(url)) is used.

Adding New Videos

1

Add the MP4 file to assets

Copy the new .mp4 file into the assets/videos/ directory of the project.
2

Declare it in pubspec.yaml

Add the path to the assets: list under flutter: in pubspec.yaml, then run flutter pub get.
3

Add a VideoItem entry

Open lib/data/local/local_data_repository.dart and add a new VideoItem to the videos getter:
VideoItem(
  id: 'your_unique_id',
  titleEs: 'Your Spanish Title',
  titleQu: 'Your Kichwa Title',
  descriptionEs: 'Brief description in Spanish.',
  descriptionQu: 'Brief description in Kichwa.',
  assetPath: 'assets/videos/your_file.mp4',
),
4

Add a visual config (optional)

In VideosScreen, add a _CardConfig entry to the configs list for the new video’s index position, specifying background color, foreground color, and icons.
Bundling large video files directly in the APK increases the app’s download and install size. For production, consider compressing videos with H.264 at 720p or lower before bundling. A 5-minute video at 720p typically compresses to 20–50 MB depending on content complexity.

VideoItem Model

Videos are immutable value objects defined in lib/data/models/video_item.dart.
class VideoItem {
  const VideoItem({
    required this.id,           // Unique identifier, e.g. 'ergo_posture'
    required this.titleEs,      // Display title in Spanish
    required this.titleQu,      // Display title in Kichwa
    required this.descriptionEs, // Short description in Spanish
    required this.descriptionQu, // Short description in Kichwa
    this.assetPath,             // Flutter asset path (preferred for offline use)
    this.url,                   // Optional remote URL fallback
  });

  final String id;
  final String titleEs;
  final String titleQu;
  final String descriptionEs;
  final String descriptionQu;
  final String? assetPath;
  final String? url;

  // Language-aware accessors
  String title(bool isKichwa) => isKichwa ? titleQu : titleEs;
  String description(bool isKichwa) => isKichwa ? descriptionQu : descriptionEs;

  // True if either assetPath or url is non-empty
  bool get hasMedia =>
      (assetPath != null && assetPath!.isNotEmpty) ||
      (url != null && url!.isNotEmpty);
}

Technical Reference

PropertyValue
Route/videos
Category eyebrowAprendizaje
State managementStatefulWidget (player screen)
Video packagevideo_player ^2.9.2
Data sourceLocalDataRepository.instance.videos
Total videos2
Fullscreen support✅ Landscape via SystemChrome
Streaming❌ None — all assets bundled in APK
Network required❌ Fully offline

Build docs developers (and LLMs) love