AnimatedListBaseReorderModel class abstract
This model is used to manage the reordering of a list view. The following callbacks has to be provided:
- onReorderStart is called first when a new request of reordering is coming. The index of the
item is passed and two other additional parameters are passed that indicate the offset of the
tap/click from the top left corner of the item; if
false
is returned, the reorder won't start at all; - onReorderFeedback called whenever the item is moved by dragging. Its item's index is passed again, then the index where it would like to move, the offset from the top of the sliver and finally a delta indicating the distance of the new point from the original one. Any value can be returned. If the last returned value is changed, a rebuild will be notified for the dragged item. The returned value will be passed to the AnimatedWidgetBuilderData of the builder.
- onReorderMove called when the dragged item, corresponding to the first index, would like to
move with the item corresponding to the second index. If
false
is returned, the move won't be taken into consideration at all; - onReorderComplete called at the end of reorder when the move must actually be done.
The last returned value from onReorderFeedback is also passed. Implement this callback
to update your underlying list. Return
false
if you want to cancel the move.
Constructors
- AnimatedListBaseReorderModel()
-
const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onReorderComplete(
int index, int dropIndex, Object? slot) → bool -
onReorderFeedback(
int index, int dropIndex, double offset, double dx, double dy) → Object? -
onReorderMove(
int index, int dropIndex) → bool -
onReorderStart(
int index, double dx, double dy) → bool -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited