SetWatcher<E> class

create a Watcher of type Set, which reacts just like normal Set, but with watcher capabilities.

Inheritance
Implemented types
Available Extensions

Constructors

SetWatcher(Set<E> initial)

Properties

first → E
The first element.
no setteroverride
hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
isDisposed bool
Flag which returns true if you called the dispose method. It is useful when you want to safely do some operations on the Watcher without getting an exception if it gets disposed.
no setterinherited
isEmpty bool
Whether this collection has no elements.
no setteroverride
isNotEmpty bool
Whether this collection has at least one element.
no setteroverride
iterator Iterator<E>
An iterator that iterates over the elements of this Watcher's value.
no setteroverride
last → E
The last element.
no setteroverride
length int
The number of elements in this.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
safeMode bool
safeMode if enabled will not allow any setting of value or notifying any listeners if the Watcher isDisposed
finalinherited
single → E
Checks that this iterable has only one element, and returns that element.
no setteroverride
stream Stream<Set<E>>
Converts the Watcher into a Stream. This stream emits values whenever the value changes. The use of distinct ensures that consecutive duplicate values are filtered out, thus the stream only emits when the value actually changes.
no setterinherited
v Set<E>
Equivalent to the getter value but in shorter syntax.
getter/setter pairinherited
value Set<E>
The current value stored in this watcher.
getter/setter pairinherited

Methods

add(E value) bool
Adds value to this Watcher's value.
override
addAll(Iterable<E> elements) → void
Adds all elements to this Watcher's value.
override
addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
any(bool test(E element)) bool
Converts each element to a String and concatenates the strings.
override
cast<R>() Set<R>
Provides a view of this Watcher's value as a set of R instances.
override
clear() → void
Removes all elements from this Watcher's value.
override
contains(Object? value) bool
Whether value is in this Watcher's value.
override
containsAll(Iterable<Object?> other) bool
Whether this Watcher's value contains all the elements of other.
override
debounce(Duration duration, void action(Set<E> value)) VoidCallback
Registers a debounced callback which is invoked only after the notifier's value is stable for the specified duration.
inherited
difference(Set<Object?> other) Set<E>
Creates a new set with the elements of this that are not in other.
override
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
elementAt(int index) → E
Returns the indexth element.
override
every(bool test(E element)) bool
Reduces a collection to a single value by iteratively combining each element of the collection with an existing value
override
expand<T>(Iterable<T> toElements(E element)) Iterable<T>
Expands each element of this Iterable into zero or more elements.
override
firstWhere(bool test(E element), {E orElse()?, bool refresh = true}) → E
The first element that satisfies the given predicate test.
override
fold<T>(T initialValue, T combine(T previousValue, E element)) → T
Reduces a collection to a single value by iteratively combining elements of the collection using the provided function.
override
followedBy(Iterable<E> other) Iterable<E>
Creates the lazy concatenation of this iterable and other.
override
forEach(void action(E element)) → void
Whether the collection contains an element equal to element.
override
intersection(Set<Object?> other) Set<E>
Creates a new set which is the intersection between this Watcher's value and other.
override
isEqual(Set<E> other) bool
Compares two sets for element-by-element equality.
join([String separator = '']) String
Checks whether every element of this iterable satisfies test.
override
lastWhere(bool test(E element), {E orElse()?, bool refresh = true}) → E
The last element that satisfies the given predicate test.
override
lookup(Object? object) → E?
If an object equal to object is in this Watcher's value, return it.
override
map<T>(T toElement(E e)) Iterable<T>
The current elements of this iterable modified by toElement.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
onChange(void action(Set<E> value)) VoidCallback
Registers a callback to be invoked whenever the ValueNotifier's value changes.
inherited
reduce(E combine(E value, E element)) → E
Reduces a collection to a single value by iteratively combining elements of the collection using the provided function.
override
refresh() → void
Rebuilds and trigger any listeners of any WatchValue or watch attached to that Watcher.
inherited
remove(Object? value) bool
Removes value from this Watcher's value.
override
removeAll(Iterable<Object?> elements) → void
Removes each element of elements from this Watcher's value.
override
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
removeWhere(bool test(E element)) → void
Removes all elements of this Watcher's value that satisfy test.
override
retainAll(Iterable<Object?> elements) → void
Removes all elements of this Watcher's value that are not elements in elements.
override
retainWhere(bool test(E element)) → void
Removes all elements of this Watcher's value that fail to satisfy test.
override
setWithoutNotify(Set<E> newValue) → void
inherited
singleWhere(bool test(E element), {E orElse()?, bool refresh = true}) → E
The single element that satisfies test.
override
skip(int count) Iterable<E>
Reduces a collection to a single value by iteratively combining each element of the collection with an existing value
override
skipWhile(bool test(E value)) Iterable<E>
Checks whether every element of this iterable satisfies test.
override
take(int count) Iterable<E>
Creates a lazy iterable of the count first elements of this iterable.
override
takeWhile(bool test(E value)) Iterable<E>
Reduces a collection to a single value by iteratively combining elements of the collection using the provided function.
override
toList({bool growable = true, bool refresh = true}) List<E>
Checks whether any element of this iterable satisfies test.
override
toSet() Set<E>
Creates a Set with the same elements and behavior as this Set.
override
toString() String
A string representation of this object.
inherited
union(Set<E> other) Set<E>
Creates a new set which contains all the elements of this Watcher's value and other.
override
updateIf(bool condition(Set<E>), Set<E> newValue) → void
Updates the ValueNotifier's value to newValue if condition returns true.
inherited
updateOnAction<R>(R action()) → R
Will notifyListeners after a specific action has been made, and optionally return a result R of certain type.
inherited
where(bool test(E element)) Iterable<E>
Creates a new lazy Iterable with all elements that satisfy the predicate test.
override
whereType<T>() Iterable<T>
Creates a new lazy Iterable with all elements that have type T.
override

Operators

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