ProgressBar constructor

const ProgressBar({
  1. Key? key,
  2. required Duration progress,
  3. required Duration total,
  4. Duration? buffered,
  5. ValueChanged<Duration>? onSeek,
  6. ThumbDragStartCallback? onDragStart,
  7. ThumbDragUpdateCallback? onDragUpdate,
  8. VoidCallback? onDragEnd,
  9. double barHeight = 5.0,
  10. Color? baseBarColor,
  11. Color? progressBarColor,
  12. Color? bufferedBarColor,
  13. BarCapShape barCapShape = BarCapShape.round,
  14. double thumbRadius = 10.0,
  15. Color? thumbColor,
  16. Color? thumbGlowColor,
  17. double thumbGlowRadius = 30.0,
  18. bool thumbCanPaintOutsideBar = true,
  19. TimeLabelLocation? timeLabelLocation,
  20. TimeLabelType? timeLabelType,
  21. TextStyle? timeLabelTextStyle,
  22. double timeLabelPadding = 0.0,
})

You must set the current audio or video duration progress and also the total duration. Optionally set the buffered content progress as well.

When a user drags the thumb to a new location you can be notified by the onSeek callback so that you can update your audio/video player.

Implementation

const ProgressBar({
  Key? key,
  required this.progress,
  required this.total,
  this.buffered,
  this.onSeek,
  this.onDragStart,
  this.onDragUpdate,
  this.onDragEnd,
  this.barHeight = 5.0,
  this.baseBarColor,
  this.progressBarColor,
  this.bufferedBarColor,
  this.barCapShape = BarCapShape.round,
  this.thumbRadius = 10.0,
  this.thumbColor,
  this.thumbGlowColor,
  this.thumbGlowRadius = 30.0,
  this.thumbCanPaintOutsideBar = true,
  this.timeLabelLocation,
  this.timeLabelType,
  this.timeLabelTextStyle,
  this.timeLabelPadding = 0.0,
}) : super(key: key);