AnimatedReorderable class abstract

The AnimatedReorderable wrapper makes ListView or GridView animated, adds reordering and swiping capabilities.

  • It animates item insertions, removals, and reordering with customizable animations.
  • It allows users to interactively reorder items with drag-and-drop gestures.
  • It supports swiping to remove items with customizable swipe actions.

This widget's AnimatedReorderableState can be used to dynamically insert, remove or reorder items. To refer to the AnimatedReorderableState either provide a GlobalKey or use the static of method from an item's input callback.

Inheritance

Constructors

AnimatedReorderable({Key? key, required KeyGetter keyGetter, BoolGetter? draggableGetter, BoolGetter? reorderableGetter, ReorderCallback? onReorder, AxisDirectionGetter? swipeToRemoveDirectionGetter, SpringDescription swipeToRemoveSpringDescription = defaultFlingSpringDescription, double swipeToRemoveExtent = defaultSwipeToRemoveExtent, double swipeToRemoveVelocity = defaultSwipeToRemoveVelocity, SwipeToRemoveCallback? onSwipeToRemove, AnimatedItemDecorator? draggedItemDecorator, Duration draggedItemDecorationAnimationDuration = defaultDraggedItemDecorationAnimationDuration, AnimatedItemDecorator? swipedItemDecorator, Duration swipedItemDecorationAnimationDuration = defaultSwipedItemDecorationAnimationDuration, Duration motionAnimationDuration = defaultMotionAnimationDuration, Curve motionAnimationCurve = defaultMotionAnimationCurve, double autoScrollerVelocityScalar = defaultAutoScrollVelocityScalar, ItemDragStartCallback? onItemDragStart, ItemDragUpdateCallback? onItemDragUpdate, ItemDragEndCallback? onItemDragEnd, ItemDragStartCallback? onItemSwipeStart, ItemDragUpdateCallback? onItemSwipeUpdate, ItemDragEndCallback? onItemSwipeEnd})
const
AnimatedReorderable.grid({Key? key, required KeyGetter keyGetter, Duration motionAnimationDuration = defaultMotionAnimationDuration, Curve motionAnimationCurve = defaultMotionAnimationCurve, double autoScrollerVelocityScalar = defaultAutoScrollVelocityScalar, BoolGetter? draggableGetter, BoolGetter? reorderableGetter, ReorderCallback? onReorder, AxisDirectionGetter? swipeToRemoveDirectionGetter, double swipeToRemoveExtent = defaultSwipeToRemoveExtent, double swipeToRemoveVelocity = defaultSwipeToRemoveVelocity, SpringDescription swipeToRemoveSpringDescription = defaultFlingSpringDescription, SwipeToRemoveCallback? onSwipeToRemove, AnimatedItemDecorator? draggedItemDecorator = defaultDraggedItemDecorator, Duration draggedItemDecorationAnimationDuration = defaultDraggedItemDecorationAnimationDuration, AnimatedItemDecorator? swipedItemDecorator = defaultDraggedItemDecorator, Duration swipedItemDecorationAnimationDuration = defaultSwipedItemDecorationAnimationDuration, ItemDragStartCallback? onItemDragStart, ItemDragUpdateCallback? onItemDragUpdate, ItemDragEndCallback? onItemDragEnd, ItemDragStartCallback? onItemSwipeStart, ItemDragUpdateCallback? onItemSwipeUpdate, ItemDragEndCallback? onItemSwipeEnd, required GridView gridView})
Creates an AnimatedReorderable for a GridView.
factory
AnimatedReorderable.list({Key? key, required KeyGetter keyGetter, Duration motionAnimationDuration = defaultMotionAnimationDuration, Curve motionAnimationCurve = defaultMotionAnimationCurve, double autoScrollerVelocityScalar = defaultAutoScrollVelocityScalar, BoolGetter? draggableGetter, BoolGetter? reorderableGetter, ReorderCallback? onReorder, AxisDirectionGetter? swipeToRemoveDirectionGetter, double swipeToRemoveExtent = defaultSwipeToRemoveExtent, double swipeToRemoveVelocity = defaultSwipeToRemoveVelocity, SpringDescription swipeToRemoveSpringDescription = defaultFlingSpringDescription, SwipeToRemoveCallback? onSwipeToRemove, AnimatedItemDecorator? draggedItemDecorator = defaultDraggedItemDecorator, Duration draggedItemDecorationAnimationDuration = defaultDraggedItemDecorationAnimationDuration, AnimatedItemDecorator? swipedItemDecorator = defaultDraggedItemDecorator, Duration swipedItemDecorationAnimationDuration = defaultSwipedItemDecorationAnimationDuration, ItemDragStartCallback? onItemDragStart, ItemDragUpdateCallback? onItemDragUpdate, ItemDragEndCallback? onItemDragEnd, ItemDragStartCallback? onItemSwipeStart, ItemDragUpdateCallback? onItemSwipeUpdate, ItemDragEndCallback? onItemSwipeEnd, required ListView listView})
Creates an AnimatedReorderable for a ListView.
factory

Properties

autoScrollerVelocityScalar double
The velocity scalar per pixel over scroll.
final
draggableGetter BoolGetter?
A function that determines whether an item at a given index is draggable.
final
draggedItemDecorationAnimationDuration Duration
The duration of the animation for decorating the dragged item.
final
draggedItemDecorator → AnimatedItemDecorator?
A callback that allows to add an animated decoration around an item when it is being dragged.
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
keyGetter KeyGetter
A function that provides the unique key for each item in the list or grid.
final
motionAnimationCurve Curve
The curve of the motion animation for item reordering.
final
motionAnimationDuration Duration
The duration of the motion animation for item reordering.
final
onItemDragEnd ItemDragEndCallback?
Callback function invoked when dragging a list or grid item ends.
final
onItemDragStart ItemDragStartCallback?
Callback function invoked when dragging a list or grid item starts.
final
onItemDragUpdate ItemDragUpdateCallback?
Callback function invoked when dragging a list or grid item is updated.
final
onItemSwipeEnd ItemDragEndCallback?
Callback function invoked when swiping a list or grid item ends.
final
onItemSwipeStart ItemDragStartCallback?
Callback function invoked when swiping a list or grid item starts.
final
onItemSwipeUpdate ItemDragUpdateCallback?
Callback function invoked when swiping a list or grid item is updated.
final
onReorder ReorderCallback?
A callback function called when items are reordered.
final
onSwipeToRemove SwipeToRemoveCallback?
A callback function called when an item is swiped for removal.
final
reorderableGetter BoolGetter?
A function that determines whether an item at a given index is reorderable.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
swipedItemDecorationAnimationDuration Duration
The duration of the animation for decorating the swiped item.
final
swipedItemDecorator → AnimatedItemDecorator?
A callback that allows to add an animated decoration around an item when it is being swiped.
final
swipeToRemoveDirectionGetter AxisDirectionGetter?
A function that determines the swipe-to-remove direction for an item at a given index.
final
swipeToRemoveExtent double
The minimal extent, as a ratio of item movement, to trigger swipe-to-remove.
final
swipeToRemoveSpringDescription SpringDescription
The spring description used for the swipe-to-remove animation.
final
swipeToRemoveVelocity double
The minimum swiping velocity required to trigger the swipe-to-remove action.
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<StatefulWidget>
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

Static Methods

maybeOf(BuildContext context) AnimatedReorderableState<AnimatedReorderable>?
The AnimatedReorderableState from the closest instance of AnimatedReorderable that encloses the given context.
of(BuildContext context) AnimatedReorderableState<AnimatedReorderable>
The state from the closest instance of this class that encloses the given context.