ReorderableFlex class
Reorderable (drag and drop) version of Flex, a widget that displays its draggable children in a one-dimensional array.
The ReorderableFlex widget has allows you to control the axis along which the children are placed (horizontal or vertical). This is referred to as the direction. If you know the main axis in advance, then consider using a ReorderableRow (if it's horizontal) or ReorderableColumn (if it's vertical) instead, because that will be less verbose.
In addition to other parameters in Flex's constructor, this widget also
has header and footer for placing non-reorderable widgets at the
top/left and bottom/right of the widget. If further control is needed, you
can use buildItemsContainer to customize how each item is contained, or
use buildDraggableFeedback to customize the feedback
of the internal
LongPressDraggable. Consider using ReorderableRow or ReorderableColumn
instead using this widget directly.
All children must have a key.
See also:
- ReorderableRow, for a version of this widget that is always horizontal.
- ReorderableColumn, for a version of this widget that is always vertical.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- ReorderableFlex
- Implementers
Constructors
-
ReorderableFlex({Key? key, Widget? header, required List<
Widget> children, required ReorderCallback onReorder, required Axis direction, Axis scrollDirection = Axis.vertical, EdgeInsets? padding, BuildItemsContainer? buildItemsContainer, BuildDraggableFeedback? buildDraggableFeedback, MainAxisAlignment mainAxisAlignment = MainAxisAlignment.start, 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}) - Creates a reorderable list.
Properties
- buildDraggableFeedback → BuildDraggableFeedback?
-
final
- buildItemsContainer → BuildItemsContainer?
-
final
-
children
→ List<
Widget> -
The widgets to display.
final
- direction → Axis
-
The Axis along which the list scrolls.
final
- draggedItemBuilder → (Widget Function(BuildContext context, int index)?)
-
final
- draggingWidgetOpacity → double
-
final
-
A non-reorderable footer widget to show after the list.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- header → Widget?
-
A non-reorderable header widget to show before the list.
final
- ignorePrimaryScrollController → bool
-
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- mainAxisAlignment → MainAxisAlignment
-
final
- needsLongPressDraggable → bool
-
final
- onNoReorder → NoReorderCallback?
-
final
- onReorder → ReorderCallback
-
Called when a child is dropped into a new position to shuffle the
children.
final
- onReorderStarted → ReorderStartedCallback?
-
Called when the draggable starts being dragged.
final
- padding → EdgeInsets?
-
The amount of space by which to inset the children.
final
- reorderAnimationDuration → Duration?
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scrollAnimationDuration → Duration?
-
final
- scrollController → ScrollController?
-
final
- scrollDirection → Axis
-
final
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.
override
-
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