ListNotifier<T> class
A list that can be listened to for changes and notifies listeners when the list changes.
- Inheritance
-
- Object
- Listenable
- ValueListenable<
List< T> > - ListListenable<
T> - ListNotifier
- Implemented types
-
- List<
T>
- List<
- 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<
The first element of this iterator, orT> , provided by the IterableExtensions extensionnullif 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<
Pairs of elements of the indices and elements of this iterable.T> , provided by the IterableExtensions extensionno 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
Iteratorthat allows iterating the elements of thisIterable.no setteroverride - last ↔ T
-
The last element.
getter/setter pairinherited-getteroverride-setter
- lastOrNull → T?
-
Available on Iterable<
The last element of this iterable, orT> , provided by the IterableExtensions extensionnullif the iterable is empty.no setter - length ↔ int
-
The number of objects in this list.
getter/setter pairoverride
-
nonNulls
→ Iterable<
T> -
Available on Iterable<
The non-T?> , provided by the NullableIterableExtensions extensionnullelements 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<
Gets all selected item values in the tree.TreeNode< , provided by the TreeNodeListExtension extensionK> >no setter -
selectedNodes
→ List<
TreeNode< K> > -
Available on List<
Gets all selected nodes in the tree.TreeNode< , provided by the TreeNodeListExtension extensionK> >no setter - single → T
-
Checks that this iterable has only one element, and returns that element.
no setterinherited
- singleOrNull → T?
-
Available on Iterable<
The single element of this iterator, orT> , provided by the IterableExtensions extensionnull.no setter -
toJS
→ JSArray<
T> -
Available on List<
Converts this List to a JSArray by either casting, unwrapping, or cloning the List.T> , provided by the ListToJSArray extensionno setter -
toJSIterable
→ JSIterable<
T> -
Available on Iterable<
A JSIterable wrapper that proxies to the Dart iterable API.T> , provided by the IterableToJSIterable extensionno setter -
toJSProxyOrRef
→ JSArray<
T> -
Available on List<
Converts this List to a JSArray by either casting, unwrapping, or proxying the List.T> , provided by the ListToJSArray extensionno setter -
value
→ List<
T> -
The current value of the object.
no setteroverride
-
wait
→ Future<
List< T> > -
Available on Iterable<
Waits for futures in parallel.Future< , provided by the FutureIterable extensionT> >no setter
Methods
-
add(
T value) → void -
Adds
valueto the end of this list, extending the length by one.override -
addAll(
Iterable< T> values) → void -
Appends all objects of
iterableto the end of this list.override -
addChangeListener(
ListChangeListener< T> listener) → void -
Adds a
listenerto 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<
Creates a map from the names of enum values to the values.T> , provided by the EnumByName extension -
buildSeparator(
ValueGetter< T> separator) → Iterable<T> -
Available on Iterable<
Joins iterable items with dynamically built separators.T> , provided by the IterableExtension extension -
byName(
String name) → T -
Available on Iterable<
Finds the enum value in this list with nameT> , provided by the EnumByName extensionname. -
cast<
R> () → List< R> -
Returns a view of this list as a list of
Rinstances.override -
clear(
) → void -
Removes all objects from this list; the length of the list becomes zero.
override
-
collapseAll(
) → List< TreeNode< K> > -
Available on List<
Collapses all nodes in the tree.TreeNode< , provided by the TreeNodeListExtension extensionK> > -
collapseItem(
K target) → List< TreeNode< K> > -
Available on List<
Collapses a node by its item value.TreeNode< , provided by the TreeNodeListExtension extensionK> > -
collapseNode(
TreeNode< K> target) → List<TreeNode< K> > -
Available on List<
Collapses a specific node.TreeNode< , provided by the TreeNodeListExtension extensionK> > -
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<
Deselects all nodes in the tree.TreeNode< , provided by the TreeNodeListExtension extensionK> > -
deselectItem(
K target) → List< TreeNode< K> > -
Available on List<
Deselects a node by its item value.TreeNode< , provided by the TreeNodeListExtension extensionK> > -
deselectItems(
Iterable< K> items) → List<TreeNode< K> > -
Available on List<
Deselects nodes by their item values.TreeNode< , provided by the TreeNodeListExtension extensionK> > -
deselectNode(
TreeNode< K> target) → List<TreeNode< K> > -
Available on List<
Deselects a specific node.TreeNode< , provided by the TreeNodeListExtension extensionK> > -
deselectNodes(
Iterable< TreeNode< nodes) → List<K> >TreeNode< K> > -
Available on List<
Deselects specific nodes.TreeNode< , provided by the TreeNodeListExtension extensionK> > -
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<
The element at positionT> , provided by the IterableExtensions extensionindexof this iterable, ornull. -
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<
Expands all nodes in the tree.TreeNode< , provided by the TreeNodeListExtension extensionK> > -
expandItem(
K target) → List< TreeNode< K> > -
Available on List<
Expands a node by its item value.TreeNode< , provided by the TreeNodeListExtension extensionK> > -
expandNode(
TreeNode< K> target) → List<TreeNode< K> > -
Available on List<
Expands a specific node.TreeNode< , provided by the TreeNodeListExtension extensionK> > -
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
actionon 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
elementin this list.override -
indexOfOrNull(
T obj, [int start = 0]) → int? -
Available on List<
Finds the first index of an element, returning null if not found.T> , provided by the ListExtension extension -
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<
Finds the first index where test is true, returning null if not found.T> , provided by the ListExtension extension -
insert(
int index, T value) → void -
Inserts
elementat positionindexin this list.override -
insertAll(
int index, Iterable< T> values) → void -
Inserts all objects of
iterableat positionindexin 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<
Joins iterable items with a separator between each.T> , provided by the IterableExtension extension -
joinSeparator(
T separator) → List< T> - Joins widgets with a separator between each item.
-
lastIndexOf(
T element, [int? start]) → int -
The last index of
elementin this list.override -
lastIndexOfOrNull(
T obj, [int? start]) → int? -
Available on List<
Finds the last index of an element, returning null if not found.T> , provided by the ListExtension extension -
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<
Finds the last index where test is true, returning null if not found.T> , provided by the ListExtension extension -
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<
Safely gets an element at index, returning null if out of bounds.T> , provided by the ListExtension extension -
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
valuefrom this list.override -
removeAt(
int index) → T -
Removes the object at position
indexfrom this list.override -
removeChangeListener(
ListChangeListener< T> listener) → void -
Removes a
listenerfrom 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<
Replaces a node by its item value.TreeNode< , provided by the TreeNodeListExtension extensionK> > -
replaceNode(
TreeNode< K> oldNode, TreeNode<K> newNode) → List<TreeNode< K> > -
Available on List<
Replaces a specific node in the tree.TreeNode< , provided by the TreeNodeListExtension extensionK> > -
replaceNodes(
TreeNodeUnaryOperator< K> operator) → List<TreeNode< K> > -
Available on List<
Applies an operator to all nodes in the tree.TreeNode< , provided by the TreeNodeListExtension extensionK> > -
replaceNodesWithParent(
TreeNodeUnaryOperatorWithParent< K> operator) → List<TreeNode< K> > -
Available on List<
Applies an operator to all nodes with parent context.TreeNode< , provided by the TreeNodeListExtension extensionK> > -
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<
Selects all nodes in the tree.TreeNode< , provided by the TreeNodeListExtension extensionK> > -
selectItem(
K target) → List< TreeNode< K> > -
Available on List<
Selects a node by its item value.TreeNode< , provided by the TreeNodeListExtension extensionK> > -
selectItems(
Iterable< K> items) → List<TreeNode< K> > -
Available on List<
Selects nodes by their item values.TreeNode< , provided by the TreeNodeListExtension extensionK> > -
selectNode(
TreeNode< K> target) → List<TreeNode< K> > -
Available on List<
Selects a specific node.TreeNode< , provided by the TreeNodeListExtension extensionK> > -
selectNodes(
Iterable< TreeNode< nodes) → List<K> >TreeNode< K> > -
Available on List<
Selects specific nodes.TreeNode< , provided by the TreeNodeListExtension extensionK> > -
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
iterableinto a range of this list.override -
setSelectedItems(
Iterable< K> items) → List<TreeNode< K> > -
Available on List<
Sets the selected items by value, replacing current selection.TreeNode< , provided by the TreeNodeListExtension extensionK> > -
setSelectedNodes(
Iterable< TreeNode< nodes) → List<K> >TreeNode< K> > -
Available on List<
Sets the selected nodes, replacing current selection.TreeNode< , provided by the TreeNodeListExtension extensionK> > -
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
countelements.inherited -
skipWhile(
bool test(T value)) → Iterable< T> -
Creates an
Iterablethat skips leading elements whiletestis satisfied.inherited -
sort(
[int compare(T a, T b)?]) → void -
Sorts this list according to the order specified by the
comparefunction.override -
sublist(
int start, [int? end]) → List< T> -
Returns a new list containing the elements between
startandend.override -
swapItem(
T element, int targetIndex) → bool -
Available on List<
Moves an element to a target index in the list.T> , provided by the ListExtension extension -
swapItemWhere(
Predicate< T> test, int targetIndex) → bool -
Available on List<
Moves the first element matching test to a target index.T> , provided by the ListExtension extension -
take(
int count) → Iterable< T> -
Creates a lazy iterable of the
countfirst 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<
Toggles selection state of all nodes in the tree.TreeNode< , provided by the TreeNodeListExtension extensionK> > -
toggleSelectItem(
K target) → List< TreeNode< K> > -
Available on List<
Toggles selection state of a node by its item value.TreeNode< , provided by the TreeNodeListExtension extensionK> > -
toggleSelectItems(
Iterable< K> targets) → List<TreeNode< K> > -
Available on List<
Toggles selection state of multiple items.TreeNode< , provided by the TreeNodeListExtension extensionK> > -
toggleSelectNode(
TreeNode< K> target) → List<TreeNode< K> > -
Available on List<
Toggles selection state of a specific node.TreeNode< , provided by the TreeNodeListExtension extensionK> > -
toggleSelectNodes(
Iterable< TreeNode< targets) → List<K> >TreeNode< K> > -
Available on List<
Toggles selection state of multiple nodes.TreeNode< , provided by the TreeNodeListExtension extensionK> > -
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<
Updates selection state based on recursive selection rules.TreeNode< , provided by the TreeNodeListExtension extensionK> > -
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
indexin the list.override -
operator []=(
int index, T value) → void -
Sets the value at the given
indexin the list tovalue.override