Lesson Player

Loading preview

Starting the Flutter app

A showcase of Flutter's lesson player functionality

Get the source

Add it to your project

Copies the Dart source into your app, so you own it. Flutter SDK only, no extra packages.

First time? Run dart pub global activate fluttertemplates_dev, or read the CLI guide.

How it works

Playback is simulated: no video loads, and the play button runs a one-second Timer that advances _positions toward _lessonSeconds. The Slider seeks, the percentage and clock derive from the position, and the timer stops at the end or on dispose. Previous and Next switch between _lessons, pause playback and keep each lesson’s position.

Adapting it

  • Put a player from the video_player package where the gray Container is, creating its controller in initState and disposing it.
  • Update _positions from that controller instead of _tick.
  • Pass lesson data into LessonPlayer to replace the hardcoded _lessons.