ListModel<E> class

Keeps a Dart List in sync with an AnimatedList.

The insert and removeAt methods apply to both the internal list and the animated list that belongs to listKey.

This class only exposes as much of the Dart List API as is needed by the sample app. More list methods are easily added, however methods that mutate the list must make the same changes to the animated list in terms of AnimatedListState.insertItem and AnimatedList.removeItem.

Inheritance
Mixed in types
  • LoggingMixin

Constructors

ListModel.ofListKey({RemovedItemBuilder<E>? removedItemBuilder, MModel? container, required GlobalKey<AnimatedListState> listKey, String? attribute, AnimationType animationType = AnimationType.slide, Iterable<E>? initialItems})
ListModel.ofObservableMap({required ObservableMap<E, dynamic> map, MModel? container, GlobalKey<AnimatedListState>? listKey, AnimationType animationType = AnimationType.slide, String? attribute})
Creates a list model that represents keys in a map

Properties

animationType AnimationType
final
attribute String?
final
container → MModel?
final
count → SingleValue<int>
final
hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
isEmpty bool
no setter
isNotEmpty bool
no setter
items Iterable<E>
no setter
length int?
no setter
listKey GlobalKey<AnimatedListState>?
final
log → Logger
no setterinherited
loggerName String
no setterinherited
removedItemBuilder RemovedItemBuilder<E>?
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

add(E item) → void
addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
cast<T>() ListModel<T>
dispose() → void
Discards any resources used by the object. After this is called, the object is not in a usable state and should be discarded (calls to addListener will throw after the object is disposed).
override
indexOf(E item) int
insert(int index, E item) → void
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
removeAt(int index) → E
removeLast() → E
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
replace(int index, E item) → void
toString() String
A string representation of this object.
inherited
updateAll(Iterable<E> newItems) bool

Operators

operator ==(Object other) bool
The equality operator.
inherited
operator [](int index) → E