SheenMiniPlayer class Music

The glass bar above the tab bar that shows what plays: the cover, title and artist, play/pause and next, and a thin progress line along its foot.

A tap or an upward drag opens the full player; a sideways swipe goes to the next or previous song (in right-to-left text, the other way round). Give the cover a heroTag to fly it into the player's cover.

SheenMiniPlayer(
  title: track.title,
  subtitle: track.artist,
  artwork: NetworkImage(track.thumb),
  playing: state.playing,
  progress: state.progress,
  onPlayPause: player.toggle,
  onNext: player.next,
  onSwipeNext: player.next,
  onSwipePrevious: player.previous,
  onOpen: () => openPlayer(context),
)
Inheritance

Constructors

SheenMiniPlayer({Key? key, required String title, String? subtitle, ImageProvider<Object>? artwork, bool playing = false, bool loading = false, double progress = 0, VoidCallback? onPlayPause, VoidCallback? onNext, VoidCallback? onSkipForward, Duration skipForward = const Duration(seconds: 30), VoidCallback? onOpen, VoidCallback? onSwipeNext, VoidCallback? onSwipePrevious, Object? heroTag})
A mini player for title.
const

Properties

artwork → ImageProvider<Object>?
The cover.
final
hashCode → int
The hash code for this object.
no setterinherited
heroTag → Object?
A hero tag for the cover.
final
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
loading → bool
Whether the song is still loading: a spinner takes the play button's place (a tap still pauses).
final
onNext → VoidCallback?
Next song.
final
onOpen → VoidCallback?
Opens the full player.
final
onPlayPause → VoidCallback?
Play or pause.
final
onSkipForward → VoidCallback?
Jump ahead skipForward (long audio: books, podcasts); when set, a skip-forward button takes the place of next.
final
onSwipeNext → VoidCallback?
A swipe towards the start (left in left-to-right text).
final
onSwipePrevious → VoidCallback?
A swipe towards the end.
final
playing → bool
Whether music plays.
final
progress → double
How far the song is, from 0 to 1.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
skipForward → Duration
How far onSkipForward goes; 30 seconds by default.
final
subtitle → String?
The artist.
final
title → String
The song's title.
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