ProgressBar class
A progress bar widget to show or set the location of the currently playing audio or video content.
This widget does not itself play audio or video content, but you can use it in conjunction with an audio plugin. It is a more convenient replacement for the Flutter Slider widget.
- Inheritance
Constructors
-
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 thetotal
duration. Optionally set thebuffered
content progress as well.const
Properties
- barCapShape → BarCapShape
-
The shape of the bar at the left and right ends.
final
- barHeight → double
-
The vertical thickness of the progress bar.
final
- baseBarColor → Color?
-
The color of the progress bar before playback has started.
final
- buffered → Duration?
-
The currently buffered content of the media.
final
- bufferedBarColor → Color?
-
The color of the progress bar between the progress location and the
buffered location.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- onDragEnd → VoidCallback?
-
A callback when the user is finished moving the thumb.
final
- onDragStart → ThumbDragStartCallback?
-
A callback when the user starts to move the thumb.
final
- onDragUpdate → ThumbDragUpdateCallback?
-
A callback when the user is moving the thumb.
final
-
onSeek
→ ValueChanged<
Duration> ? -
A callback when user moves the thumb.
final
- progress → Duration
-
The elapsed playing time of the media.
final
- progressBarColor → Color?
-
The color of the progress bar to the left of the current playing
progress.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- thumbCanPaintOutsideBar → bool
-
Whether the thumb radius will before the start of the bar when at the
beginning or after the end of the bar when at the end.
final
- thumbColor → Color?
-
The color of the circle for the moveable progress bar thumb.
final
- thumbGlowColor → Color?
-
The color of the pressed-down effect of the moveable progress bar thumb.
final
- thumbGlowRadius → double
-
The radius of the circle for the pressed-down effect of the moveable
progress bar thumb.
final
- thumbRadius → double
-
The radius of the circle for the moveable progress bar thumb.
final
- timeLabelLocation → TimeLabelLocation?
-
The location for the progress and total duration text labels.
final
- timeLabelPadding → double
-
The extra space between the time labels and the progress bar.
final
- timeLabelTextStyle → TextStyle?
-
The TextStyle used by the time labels.
final
- timeLabelType → TimeLabelType?
-
What to display for the time label on the right
final
- total → Duration
-
The total duration of the media.
final
Methods
-
createElement(
) → LeafRenderObjectElement -
RenderObjectWidgets always inflate to a RenderObjectElement subclass.
inherited
-
createRenderObject(
BuildContext context) → _RenderProgressBar -
Creates an instance of the RenderObject class that this
RenderObjectWidget represents, using the configuration described by this
RenderObjectWidget.
override
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
override
-
didUnmountRenderObject(
covariant RenderObject renderObject) → void -
A render object previously associated with this widget has been removed
from the tree. The given RenderObject will be of the same type as
returned by this object's createRenderObject.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
-
updateRenderObject(
BuildContext context, covariant _RenderProgressBar renderObject) → void -
Copies the configuration described by this RenderObjectWidget to the
given RenderObject, which will be of the same type as returned by this
object's createRenderObject.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited