AnimatedListDiffDispatcher<T> class
This class takes an initial list that can be replaced with a new one through
the dispatchNewList method.
When a new list is provided, the Myers diff algorithm runs to detect the differences.
These differences will be dispatched to the controller provided.
If the total item count is greater that the spawnNewInsolateCount parameter, the algorithm
will be executed in a separated Isolate
.
An builder has to be provided to build replaced and changed items (as required
by AnimatedListController.notifyChangedRange, AnimatedListController.notifyReplacedRange
and AnimatedListController.notifyRemovedRange methods).
The two lists are compared using the comparator provided.
- Implementers
Constructors
-
AnimatedListDiffDispatcher({required T initialList, required AnimatedListController controller, required AnimatedListDiffBuilder<
T> builder, required AnimatedListDiffBaseComparator<T> comparator, int spawnNewInsolateCount = kSpawnNewIsolateCount})
Properties
-
builder
→ AnimatedListDiffBuilder<
T> -
final
-
comparator
→ AnimatedListDiffBaseComparator<
T> -
final
- controller → AnimatedListController
-
final
- currentList → T
-
It returns the current underlying list.
This corresponds to the last list passed to the dispatchNewList method if only the
Meyes algorithm is not yet running.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasPendingTask → bool
-
It returns
true
if the Meyes algorithm is still running.no setter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- spawnNewInsolateCount → int
-
final
Methods
-
discard(
) → T? - It stops this dispatcher from processing the Meyes algorithm and returns the list is currently being processed, if any.
-
dispatchNewList(
T newList, {bool detectMoves = false}) → Future< void> - It replaces the current list with the new one. Differences are calculated and then dispatched to the controller.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited