ProgressBar constructor
const
ProgressBar({
- Key? key,
- required Duration progress,
- required Duration total,
- Duration? buffered,
- ValueChanged<
Duration> ? onSeek, - ThumbDragStartCallback? onDragStart,
- ThumbDragUpdateCallback? onDragUpdate,
- VoidCallback? onDragEnd,
- double barHeight = 5.0,
- Color? baseBarColor,
- Color? progressBarColor,
- Color? bufferedBarColor,
- BarCapShape barCapShape = BarCapShape.round,
- double thumbRadius = 10.0,
- Color? thumbColor,
- Color? thumbGlowColor,
- double thumbGlowRadius = 30.0,
- bool thumbCanPaintOutsideBar = true,
- TimeLabelLocation? timeLabelLocation,
- TimeLabelType? timeLabelType,
- TextStyle? timeLabelTextStyle,
- 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);