SheenTrackRow class Music
One song in a list: its cover, title, artist and a short fact ("4.1M plays", "3:56"), with a save button and a menu button at the end.
The current song shows its title in the accent and, while playing, small moving bars. A long press opens the menu, as on iOS. Titles keep one line and end in an ellipsis at any text size.
SheenTrackRow(
title: track.title,
subtitle: track.artist,
meta: track.plays,
artwork: NetworkImage(track.thumb),
current: track.id == player.currentId,
playing: player.playing,
onDevice: store.has(track.id),
save: store.saveStateOf(track.id),
saveProgress: store.progressOf(track.id),
onTap: () => player.playList(tracks, index),
onSave: () => store.toggle(track),
onMore: () => showTrackMenu(context, track),
)
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- SheenTrackRow
Constructors
-
SheenTrackRow({Key? key, required String title, String? subtitle, String? meta, ImageProvider<
Object> ? artwork, Widget? leading, bool current = false, bool playing = false, bool onDevice = false, bool dimmed = false, SheenTrackSave save = SheenTrackSave.none, double? saveProgress, VoidCallback? onTap, VoidCallback? onSave, VoidCallback? onMore, Widget? trailing}) -
A row for the song called
title.const
Properties
-
artwork
→ ImageProvider<
Object> ? -
The cover; a placeholder when null.
final
- current → bool
-
Whether this is the song in the player.
final
- dimmed → bool
-
Draws the row faded, for songs that cannot play now (offline).
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?
-
Replaces the cover, for example with a track number in an album.
final
- meta → String?
-
A short fact after the subtitle.
final
- onDevice → bool
-
Shows the on-device mark before the subtitle (unless the save button already shows it).
final
- onMore → VoidCallback?
-
Opens the song's menu; also on a long press.
final
- onSave → VoidCallback?
-
Saves the song, or (when saved) asks to remove it.
final
- onTap → VoidCallback?
-
Plays the song.
final
- playing → bool
-
Whether the player plays (the bars move on the current row).
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- save → SheenTrackSave
-
The save button's state.
final
- saveProgress → double?
-
How much of the song is stored while save is SheenTrackSave.saving, from 0 to 1.
final
- subtitle → String?
-
The artist (or album).
final
- title → String
-
The song's title.
final
- trailing → Widget?
-
Replaces the save and menu buttons, for example with a drag handle.
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