SheenReorderList<T> class Music

A list whose rows can be dragged by a handle into a new order and swiped away, as a queue or a playlist is edited.

itemBuilder gets a ready drag handle to place in the row (usually at its end). onReorder receives the row's index before the move and its index after it. A swipe towards the start removes a row and calls onRemove.

SheenReorderList<Track>(
  items: queue,
  keyOf: (t) => ValueKey(t.id),
  onReorder: player.move,
  onRemove: player.removeAt,
  itemBuilder: (context, t, i, handle) => SheenTrackRow(title: t.title, trailing: handle),
)
Inheritance

Constructors

SheenReorderList({Key? key, required List<T> items, required Key keyOf(T item), required Widget itemBuilder(BuildContext context, T item, int index, Widget handle), void onReorder(int from, int to)?, ValueChanged<int>? onRemove, String? removeLabel, bool shrinkWrap = false, ScrollPhysics? physics, EdgeInsetsGeometry? padding})
A reorderable list of items.
const

Properties

hashCode → int
The hash code for this object.
no setterinherited
itemBuilder → Widget Function(BuildContext context, T item, int index, Widget handle)
Builds a row; place handle in it.
final
items → List<T>
The rows' items.
final
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
keyOf → Key Function(T item)
A stable key per item.
final
onRemove → ValueChanged<int>?
Called after a swipe with the removed index; rows cannot be swiped when null.
final
onReorder → void Function(int from, int to)?
Called after a drag with the old and the new index.
final
padding → EdgeInsetsGeometry?
Space around the rows.
final
physics → ScrollPhysics?
The scroll physics.
final
removeLabel → String?
What the swipe's background says; SheenMusicStrings.remove by default.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
shrinkWrap → bool
Sizes the list to its rows, for a list inside another scroll view.
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