ReorderableRow class

Reorderable (drag and drop) version of Row, a widget that displays its draggable children in horizontally.

In addition to other parameters in Row's constructor, this widget also has header and footer for placing non-reorderable widgets at the top and bottom of the widget, and buildDraggableFeedback to customize the feedback widget of the internal LongPressDraggable.

The onReorder function must be defined. A typical onReorder function looks like the following:

void _onReorder(int oldIndex, int newIndex) {
  setState(() {
    Widget row = _rows.removeAt(oldIndex);
    _rows.insert(newIndex, row);
  });
}

All children must have a key.

See also:

Inheritance

Constructors

ReorderableRow({required ReorderCallback onReorder, Key? key, Widget? header, Widget? footer, EdgeInsets? padding, MainAxisAlignment mainAxisAlignment = MainAxisAlignment.start, MainAxisSize mainAxisSize = MainAxisSize.max, CrossAxisAlignment crossAxisAlignment = CrossAxisAlignment.center, TextDirection? textDirection, VerticalDirection verticalDirection = VerticalDirection.down, TextBaseline? textBaseline, List<Widget> children = const <Widget>[], BuildDraggableFeedback? buildDraggableFeedback, NoReorderCallback? onNoReorder, ReorderStartedCallback? onReorderStarted, ScrollController? scrollController, bool needsLongPressDraggable = true, double draggingWidgetOpacity = 0.2, Duration? reorderAnimationDuration, Duration? scrollAnimationDuration, Widget draggedItemBuilder(BuildContext context, int index)?, bool ignorePrimaryScrollController = false})

Properties

buildDraggableFeedback → BuildDraggableFeedback?
finalinherited
buildItemsContainer → BuildItemsContainer?
finalinherited
children List<Widget>
The widgets to display.
finalinherited
direction Axis
The Axis along which the list scrolls.
finalinherited
draggedItemBuilder → (Widget Function(BuildContext context, int index)?)
finalinherited
draggingWidgetOpacity double
finalinherited
A non-reorderable footer widget to show after the list.
finalinherited
hashCode int
The hash code for this object.
no setterinherited
A non-reorderable header widget to show before the list.
finalinherited
ignorePrimaryScrollController bool
finalinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
mainAxisAlignment MainAxisAlignment
finalinherited
needsLongPressDraggable bool
finalinherited
onNoReorder → NoReorderCallback?
finalinherited
onReorder ReorderCallback
Called when a child is dropped into a new position to shuffle the children.
finalinherited
onReorderStarted → ReorderStartedCallback?
Called when the draggable starts being dragged.
finalinherited
padding EdgeInsets?
The amount of space by which to inset the children.
finalinherited
reorderAnimationDuration Duration?
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scrollAnimationDuration Duration?
finalinherited
scrollController ScrollController?
finalinherited
scrollDirection Axis
finalinherited

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → _ReorderableFlexState
Creates the mutable state for this widget at a given 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}) 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