SheenTransportControls class Music
The row of a player's controls: shuffle, previous, play/pause on a large glass circle, next and repeat.
For long audio (books, podcasts), onSkipBack and onSkipForward put "back 15" and "forward 30" buttons in place of previous and next, and leading and trailing take the places of shuffle and repeat (a speed button, a sleep timer).
Shuffle and repeat turn the accent colour when on; repeat shows a "1" when one song repeats. The play glyph cross- fades into pause. Media controls keep their direction in right-to-left text, as Apple's guidelines ask.
SheenTransportControls(
playing: state.playing,
onPlayPause: player.toggle,
onNext: player.next,
onPrevious: player.previous,
shuffle: state.shuffle,
onShuffle: player.toggleShuffle,
repeat: state.repeat,
onRepeat: player.cycleRepeat,
)
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- SheenTransportControls
Constructors
- SheenTransportControls({Key? key, required bool playing, bool loading = false, VoidCallback? onPlayPause, VoidCallback? onNext, VoidCallback? onPrevious, bool shuffle = false, VoidCallback? onShuffle, SheenRepeatMode repeat = SheenRepeatMode.off, VoidCallback? onRepeat, VoidCallback? onSkipBack, VoidCallback? onSkipForward, Duration skipBack = const Duration(seconds: 15), Duration skipForward = const Duration(seconds: 30), Widget? leading, Widget? trailing, Color? color})
-
Controls for a player that is
playingor paused.const
Properties
- color → Color?
-
The glyph colour; the theme's text colour by default.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- leading → Widget?
-
A small control at the start in place of shuffle, such as a speed button; about 44 points square.
final
- loading → bool
-
Whether the song is still loading: a spinner fills the play button (a tap still pauses).
final
- onNext → VoidCallback?
-
Next song.
final
- onPlayPause → VoidCallback?
-
Play or pause.
final
- onPrevious → VoidCallback?
-
Previous song (or back to the start of this one).
final
- onRepeat → VoidCallback?
-
Move to the next repeat mode; the button is hidden when null.
final
- onShuffle → VoidCallback?
-
Toggle shuffle; the button is hidden when null.
final
- onSkipBack → VoidCallback?
-
Jump back skipBack (long audio: books, podcasts). When set, a skip-back button takes the place of previous.
final
- onSkipForward → VoidCallback?
-
Jump ahead skipForward. When set, a skip-forward button takes the place of next.
final
- playing → bool
-
Whether music plays (the big button shows pause).
final
- repeat → SheenRepeatMode
-
What repeats.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- shuffle → bool
-
Whether shuffle is on.
final
- skipBack → Duration
-
How far onSkipBack goes, shown in its button; 15 seconds by default.
final
- skipForward → Duration
-
How far onSkipForward goes, shown in its button; 30 seconds by default.
final
- trailing → Widget?
-
A small control at the end in place of repeat, such as a sleep timer button.
final
Methods
-
build(
BuildContext context) → Widget -
Describes the part of the user interface represented by this widget.
override
-
createElement(
) → StatelessElement -
Creates a StatelessElement to manage this widget's location in the tree.
inherited
-
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.
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
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited