MoveItemEvent<T> class
Implements move logic of the item. Manages remove and insert animations.
Descendant of ModificationEventWithItemAndItemIdConstructors.
See also:
- Inheritance
-
- Object
- ModificationEventWithItemAndItemIdConstructors<
T> - MoveItemEvent
- Mixed-in types
Constructors
- MoveItemEvent({required T item, required int newIndex, bool animateWhenIndexDidNotChanged = false, AnimationConfigsBuilder? animationConfigsBuilder, bool forceNotify = false})
-
Creates a MoveItemEvent using an
iteminstance. - MoveItemEvent.byId({required String itemId, required int newIndex, bool animateWhenIndexDidNotChanged = false, AnimationConfigsBuilder? animationConfigsBuilder, bool forceNotify = false})
- Creates a MoveItemEvent using an item's id
Properties
- animateWhenIndexDidNotChanged → bool
-
Whether should animations be executed if the old index and new index are
equal
final
- animationConfigsBuilder → AnimationConfigsBuilder?
-
Callback, which builds a RemoveAndInsertAnimationConfigs
using given
currentIndexfinal - forceNotify → bool
-
Whether should ItemsNotifier notify its listeners immediately
after inserting the item, or delegate this task to the
ItemsNotifier itself
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- item → T?
-
The item. item is not null only if the current instance of
ModificationEvent is created using the default constructor.
finalinherited
- itemId → String?
-
The id of the item. itemId is not null only of the current instance
of ModificationEvent is created using the
byIdconstructor.finalinherited - newIndex → int
-
Index, at which item should be inserted
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
dispose(
) → void -
Stops and disposes instansiated previously AnimationController.
If AnimationController was not instantiated, does nothing.
inherited
-
execute(
{required TickerProvider vsync, required ItemsNotifier< T> itemsNotifier, required EventController<T> eventController, required ItemsAnimationController<DoubleAnimation> itemsAnimationController, required Type scrollViewType}) → Future<void> -
Method, that should contain all the logic of item list
modifications(inserting, deleting, moving, etc.), and animations, that
should be executed when an item is deleted/inserted.
override
-
generateRemoveAnimation(
{required AnimationControllerConfig removeAnimationConfig, required ItemsAnimationController< DoubleAnimation> itemsAnimationController, required ItemsNotifier<T> itemsNotifier, required String itemId, bool forceNotify = false}) → T -
Instantiates an animation, runs it, and disposes on execution end
inherited
-
getAnimation(
TickerProvider vsync, {AnimationControllerConfig config = const AnimationControllerConfig()}) → AnimationController -
Instantiates(if wasn't previously) an AnimationController and returns
it. If an AnimationController was instantiated, returns that instance.
inherited
-
getItemId(
IDMapper< T> idMapper) → String -
Returns the id of the item.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
throwIfIndexIsInvalid(
ItemsNotifier< T> itemsNotifier, int index) → void -
If index is less than zero, or greater than item list length, then
throws InvalidInsertionIndexException.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited