ListValueNotifier<T> class final

A ChangeNotifier that holds a list of data.

This class also exposes methods to modify the underlying List. When the List is modified, listeners are notified.

Inheritance
Implemented types

Constructors

ListValueNotifier(List<T> rawList)
Creates a ListValueNotifier that wraps this value _rawList.

Properties

hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
last ← T
no getter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
value List<T>
The current value of the object. When the value changes, the callbacks registered with addListener will be invoked.
no setteroverride

Methods

add(T element) → void
Adds an element to the list and notifies listeners.
addAll(Iterable<T> elements) → void
Adds elements to the list and notifies listeners.
addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
clear() → void
Clears the list and notifies listeners.
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).
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
override
remove(T value) bool
Removes the first occurrence of value from this list.
removeAll(Iterable<T> elements) → void
removeAt(int index) → void
Removes the object at position index from this list.
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
removeRange(int start, int end) → void
Removes a range of elements from the list.
replace(T existing, T replacement) bool
Replaces the first occurrence of value in this list.
replaceAll(Iterable<T> elements) → void
Replaces all elements in the list and notifies listeners. It's preferred to calling .clear() then .addAll(), because it only notifies listeners once.
toString() String
A string representation of this object.
inherited
trimToSublist(int start, [int? end]) → void
Truncates to just the elements between start and end.

Operators

operator ==(Object other) bool
The equality operator.
inherited