ListNotifier<T> class

A list that can be listened to for changes and notifies listeners when the list changes.

Inheritance
Implemented types
Mixed-in types
Available extensions

Constructors

ListNotifier([List<T> list = const []])
Creates a list notifier.

Properties

first ↔ T
The first element.
getter/setter pairinherited-getteroverride-setter
firstOrNull → T?

Available on Iterable<T>, provided by the IterableExtensions extension

The first element of this iterator, or null if the iterable is empty.
no setter
hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether the object has listeners.
no setterinherited
indexed Iterable<(int, T)>

Available on Iterable<T>, provided by the IterableExtensions extension

Pairs of elements of the indices and elements of this iterable.
no setter
isEmpty bool
Whether this collection has no elements.
no setterinherited
isNotEmpty bool
Whether this collection has at least one element.
no setterinherited
iterator Iterator<T>
A new Iterator that allows iterating the elements of this Iterable.
no setteroverride
last ↔ T
The last element.
getter/setter pairinherited-getteroverride-setter
lastOrNull → T?

Available on Iterable<T>, provided by the IterableExtensions extension

The last element of this iterable, or null if the iterable is empty.
no setter
length int
The number of objects in this list.
getter/setter pairoverride
nonNulls Iterable<T>

Available on Iterable<T?>, provided by the NullableIterableExtensions extension

The non-null elements of this iterable.
no setter
reversed Iterable<T>
An Iterable of the objects in this list in reverse order.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
selectedItems List<K>

Available on List<TreeNode<K>>, provided by the TreeNodeListExtension extension

Gets all selected item values in the tree.
no setter
selectedNodes List<TreeNode<K>>

Available on List<TreeNode<K>>, provided by the TreeNodeListExtension extension

Gets all selected nodes in the tree.
no setter
single → T
Checks that this iterable has only one element, and returns that element.
no setterinherited
singleOrNull → T?

Available on Iterable<T>, provided by the IterableExtensions extension

The single element of this iterator, or null.
no setter
toJS JSArray<T>

Available on List<T>, provided by the ListToJSArray extension

Converts this List to a JSArray by either casting, unwrapping, or cloning the List.
no setter
toJSIterable JSIterable<T>

Available on Iterable<T>, provided by the IterableToJSIterable extension

A JSIterable wrapper that proxies to the Dart iterable API.
no setter
toJSProxyOrRef JSArray<T>

Available on List<T>, provided by the ListToJSArray extension

Converts this List to a JSArray by either casting, unwrapping, or proxying the List.
no setter
value List<T>
The current value of the object.
no setteroverride
wait Future<List<T>>

Available on Iterable<Future<T>>, provided by the FutureIterable extension

Waits for futures in parallel.
no setter

Methods

add(T value) → void
Adds value to the end of this list, extending the length by one.
override
addAll(Iterable<T> values) → void
Appends all objects of iterable to the end of this list.
override
addChangeListener(ListChangeListener<T> listener) → void
Adds a listener to be notified of changes.
override
addListener(VoidCallback listener) → void
Register a closure to be called when the object notifies its listeners.
override
any(bool test(T element)) bool
Checks whether any element of this iterable satisfies test.
inherited
asMap() Map<int, T>
An unmodifiable Map view of this list.
override
asNameMap() Map<String, T>

Available on Iterable<T>, provided by the EnumByName extension

Creates a map from the names of enum values to the values.
buildSeparator(ValueGetter<T> separator) Iterable<T>

Available on Iterable<T>, provided by the IterableExtension extension

Joins iterable items with dynamically built separators.
byName(String name) → T

Available on Iterable<T>, provided by the EnumByName extension

Finds the enum value in this list with name name.
cast<R>() List<R>
Returns a view of this list as a list of R instances.
override
clear() → void
Removes all objects from this list; the length of the list becomes zero.
override
collapseAll() List<TreeNode<K>>

Available on List<TreeNode<K>>, provided by the TreeNodeListExtension extension

Collapses all nodes in the tree.
collapseItem(K target) List<TreeNode<K>>

Available on List<TreeNode<K>>, provided by the TreeNodeListExtension extension

Collapses a node by its item value.
collapseNode(TreeNode<K> target) List<TreeNode<K>>

Available on List<TreeNode<K>>, provided by the TreeNodeListExtension extension

Collapses a specific node.
contains(Object? element) bool
Whether the collection contains an element equal to element.
inherited
defaultAddListener(ChangeListener listener) → void
Add a listener to the list of listeners.
inherited
defaultNotifyListeners(Object? event) → void
Notify all the listeners.
inherited
defaultRemoveListener(ChangeListener listener) → void
Remove a listener from the list of listeners.
inherited
deselectAll() List<TreeNode<K>>

Available on List<TreeNode<K>>, provided by the TreeNodeListExtension extension

Deselects all nodes in the tree.
deselectItem(K target) List<TreeNode<K>>

Available on List<TreeNode<K>>, provided by the TreeNodeListExtension extension

Deselects a node by its item value.
deselectItems(Iterable<K> items) List<TreeNode<K>>

Available on List<TreeNode<K>>, provided by the TreeNodeListExtension extension

Deselects nodes by their item values.
deselectNode(TreeNode<K> target) List<TreeNode<K>>

Available on List<TreeNode<K>>, provided by the TreeNodeListExtension extension

Deselects a specific node.
deselectNodes(Iterable<TreeNode<K>> nodes) List<TreeNode<K>>

Available on List<TreeNode<K>>, provided by the TreeNodeListExtension extension

Deselects specific nodes.
dispose() → void
Disposes the object making it unusable for further operations and releasing the resources.
inherited
elementAt(int index) → T
Returns the indexth element.
inherited
elementAtOrNull(int index) → T?

Available on Iterable<T>, provided by the IterableExtensions extension

The element at position index of this iterable, or null.
every(bool test(T element)) bool
Checks whether every element of this iterable satisfies test.
inherited
expand<T>(Iterable<T> toElements(T element)) Iterable<T>
Expands each element of this Iterable into zero or more elements.
inherited
expandAll() List<TreeNode<K>>

Available on List<TreeNode<K>>, provided by the TreeNodeListExtension extension

Expands all nodes in the tree.
expandItem(K target) List<TreeNode<K>>

Available on List<TreeNode<K>>, provided by the TreeNodeListExtension extension

Expands a node by its item value.
expandNode(TreeNode<K> target) List<TreeNode<K>>

Available on List<TreeNode<K>>, provided by the TreeNodeListExtension extension

Expands a specific node.
fillRange(int start, int end, [T? fillValue]) → void
Overwrites a range of elements with fillValue.
override
firstWhere(bool test(T element), {T orElse()?}) → T
The first element that satisfies the given predicate test.
inherited
fold<T>(T initialValue, T combine(T previousValue, T element)) → T
Reduces a collection to a single value by iteratively combining each element of the collection with an existing value
inherited
followedBy(Iterable<T> other) Iterable<T>
Creates the lazy concatenation of this iterable and other.
inherited
forEach(void action(T element)) → void
Invokes action on each element of this iterable in iteration order.
inherited
getRange(int start, int end) Iterable<T>
Creates an Iterable that iterates over a range of elements.
override
indexOf(T element, [int start = 0]) int
The first index of element in this list.
override
indexOfOrNull(T obj, [int start = 0]) int?

Available on List<T>, provided by the ListExtension extension

Finds the first index of an element, returning null if not found.
indexWhere(bool test(T element), [int start = 0]) int
The first index in the list that satisfies the provided test.
override
indexWhereOrNull(Predicate<T> test, [int start = 0]) int?

Available on List<T>, provided by the ListExtension extension

Finds the first index where test is true, returning null if not found.
insert(int index, T value) → void
Inserts element at position index in this list.
override
insertAll(int index, Iterable<T> values) → void
Inserts all objects of iterable at position index in this list.
override
join([String separator = ""]) String
Converts each element to a String and concatenates the strings.
inherited
joinSeparator(T separator) Iterable<T>

Available on Iterable<T>, provided by the IterableExtension extension

Joins iterable items with a separator between each.
joinSeparator(T separator) List<T>

Available on List<T>, provided by the Joinable extension

Joins widgets with a separator between each item.
lastIndexOf(T element, [int? start]) int
The last index of element in this list.
override
lastIndexOfOrNull(T obj, [int? start]) int?

Available on List<T>, provided by the ListExtension extension

Finds the last index of an element, returning null if not found.
lastIndexWhere(bool test(T element), [int? start]) int
The last index in the list that satisfies the provided test.
override
lastIndexWhereOrNull(Predicate<T> test, [int? start]) int?

Available on List<T>, provided by the ListExtension extension

Finds the last index where test is true, returning null if not found.
lastWhere(bool test(T element), {T orElse()?}) → T
The last element that satisfies the given predicate test.
inherited
map<T>(T toElement(T e)) Iterable<T>
The current elements of this iterable modified by toElement.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners(ListChangeDetails<T> details) → void
Notifies listeners of the changes.
optGet(int index) → T?

Available on List<T>, provided by the ListExtension extension

Safely gets an element at index, returning null if out of bounds.
otpToString() String

Available on OTPCodepointList, provided by the OTPCodepointListExtension extension

Converts the codepoint list to a string.
reduce(T combine(T value, T element)) → T
Reduces a collection to a single value by iteratively combining elements of the collection using the provided function.
inherited
remove(Object? value) bool
Removes the first occurrence of value from this list.
override
removeAt(int index) → T
Removes the object at position index from this list.
override
removeChangeListener(ListChangeListener<T> listener) → void
Removes a listener from being notified of changes.
override
removeLast() → T
Removes and returns the last object in this list.
override
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that the object notifies.
override
removeRange(int start, int end) → void
Removes a range of elements from the list.
override
removeWhere(bool test(T element)) → void
Removes all objects from this list that satisfy test.
override
replaceItem(K oldItem, TreeNode<K> newItem) List<TreeNode<K>>

Available on List<TreeNode<K>>, provided by the TreeNodeListExtension extension

Replaces a node by its item value.
replaceNode(TreeNode<K> oldNode, TreeNode<K> newNode) List<TreeNode<K>>

Available on List<TreeNode<K>>, provided by the TreeNodeListExtension extension

Replaces a specific node in the tree.
replaceNodes(TreeNodeUnaryOperator<K> operator) List<TreeNode<K>>

Available on List<TreeNode<K>>, provided by the TreeNodeListExtension extension

Applies an operator to all nodes in the tree.
replaceNodesWithParent(TreeNodeUnaryOperatorWithParent<K> operator) List<TreeNode<K>>

Available on List<TreeNode<K>>, provided by the TreeNodeListExtension extension

Applies an operator to all nodes with parent context.
replaceRange(int start, int end, Iterable<T> newContents) → void
Replaces a range of elements with the elements of replacements.
override
retainWhere(bool test(T element)) → void
Removes all objects from this list that fail to satisfy test.
override
selectAll() List<TreeNode<K>>

Available on List<TreeNode<K>>, provided by the TreeNodeListExtension extension

Selects all nodes in the tree.
selectItem(K target) List<TreeNode<K>>

Available on List<TreeNode<K>>, provided by the TreeNodeListExtension extension

Selects a node by its item value.
selectItems(Iterable<K> items) List<TreeNode<K>>

Available on List<TreeNode<K>>, provided by the TreeNodeListExtension extension

Selects nodes by their item values.
selectNode(TreeNode<K> target) List<TreeNode<K>>

Available on List<TreeNode<K>>, provided by the TreeNodeListExtension extension

Selects a specific node.
selectNodes(Iterable<TreeNode<K>> nodes) List<TreeNode<K>>

Available on List<TreeNode<K>>, provided by the TreeNodeListExtension extension

Selects specific nodes.
setAll(int index, Iterable<T> values) → void
Overwrites elements with the objects of iterable.
override
setRange(int start, int end, Iterable<T> newContents, [int skipCount = 0]) → void
Writes some elements of iterable into a range of this list.
override
setSelectedItems(Iterable<K> items) List<TreeNode<K>>

Available on List<TreeNode<K>>, provided by the TreeNodeListExtension extension

Sets the selected items by value, replacing current selection.
setSelectedNodes(Iterable<TreeNode<K>> nodes) List<TreeNode<K>>

Available on List<TreeNode<K>>, provided by the TreeNodeListExtension extension

Sets the selected nodes, replacing current selection.
shuffle([Random? random]) → void
Shuffles the elements of this list randomly.
override
singleWhere(bool test(T element), {T orElse()?}) → T
The single element that satisfies test.
inherited
skip(int count) Iterable<T>
Creates an Iterable that provides all but the first count elements.
inherited
skipWhile(bool test(T value)) Iterable<T>
Creates an Iterable that skips leading elements while test is satisfied.
inherited
sort([int compare(T a, T b)?]) → void
Sorts this list according to the order specified by the compare function.
override
sublist(int start, [int? end]) List<T>
Returns a new list containing the elements between start and end.
override
swapItem(T element, int targetIndex) bool

Available on List<T>, provided by the ListExtension extension

Moves an element to a target index in the list.
swapItemWhere(Predicate<T> test, int targetIndex) bool

Available on List<T>, provided by the ListExtension extension

Moves the first element matching test to a target index.
take(int count) Iterable<T>
Creates a lazy iterable of the count first elements of this iterable.
inherited
takeWhile(bool test(T value)) Iterable<T>
Creates a lazy iterable of the leading elements satisfying test.
inherited
toggleSelectAll() List<TreeNode<K>>

Available on List<TreeNode<K>>, provided by the TreeNodeListExtension extension

Toggles selection state of all nodes in the tree.
toggleSelectItem(K target) List<TreeNode<K>>

Available on List<TreeNode<K>>, provided by the TreeNodeListExtension extension

Toggles selection state of a node by its item value.
toggleSelectItems(Iterable<K> targets) List<TreeNode<K>>

Available on List<TreeNode<K>>, provided by the TreeNodeListExtension extension

Toggles selection state of multiple items.
toggleSelectNode(TreeNode<K> target) List<TreeNode<K>>

Available on List<TreeNode<K>>, provided by the TreeNodeListExtension extension

Toggles selection state of a specific node.
toggleSelectNodes(Iterable<TreeNode<K>> targets) List<TreeNode<K>>

Available on List<TreeNode<K>>, provided by the TreeNodeListExtension extension

Toggles selection state of multiple nodes.
toList({bool growable = true}) List<T>
Creates a List containing the elements of this Iterable.
inherited
toSet() Set<T>
Creates a Set containing the same elements as this iterable.
inherited
toString() String
A string representation of this object.
override
updateRecursiveSelection() List<TreeNode<K>>

Available on List<TreeNode<K>>, provided by the TreeNodeListExtension extension

Updates selection state based on recursive selection rules.
where(bool test(T element)) Iterable<T>
Creates a new lazy Iterable with all elements that satisfy the predicate test.
inherited
whereType<T>() Iterable<T>
Creates a new lazy Iterable with all elements that have type T.
inherited

Operators

operator +(List<T> other) List<T>
Returns the concatenation of this list and other.
override
operator ==(Object other) bool
The equality operator.
inherited
operator [](int index) → T
The object at the given index in the list.
override
operator []=(int index, T value) → void
Sets the value at the given index in the list to value.
override