BetterSetNotifications<T> extension
Extension to provide additional methods for VN<Set<T>>.
The BetterSetNotifications extension enhances the functionality of VN<Set<T>>
by adding convenience methods for common set operations, while respecting
the ChangeType configuration of the parent VN instance.
Features:
- Index-based element retrieval.
- Set inspection properties (
isEmpty,isNotEmpty,length, etc.). - Methods for adding, removing, and clearing elements.
- Functional utilities for set transformations.
Properties
- first → T
-
Available on VN<
Returns the first element in the set.Set< , provided by the BetterSetNotifications extensionT> >no setter - firstOrNull → T?
-
Available on VN<
Returns the first element in the set, orSet< , provided by the BetterSetNotifications extensionT> >nullif the set is empty.no setter - isEmpty → bool
-
Available on VN<
ReturnsSet< , provided by the BetterSetNotifications extensionT> >trueif the set has no elements.no setter - isNotEmpty → bool
-
Available on VN<
ReturnsSet< , provided by the BetterSetNotifications extensionT> >trueif the set has one or more elements.no setter - last → T
-
Available on VN<
Returns the last element in the set.Set< , provided by the BetterSetNotifications extensionT> >no setter - lastOrNull → T?
-
Available on VN<
Returns the last element in the set, orSet< , provided by the BetterSetNotifications extensionT> >nullif the set is empty.no setter - length → int
-
Available on VN<
Returns the number of elements in the set.Set< , provided by the BetterSetNotifications extensionT> >no setter
Methods
-
add(
T value) → bool -
Available on VN<
Adds the givenSet< , provided by the BetterSetNotifications extensionT> >valueto the set. -
addAll(
Iterable< T> values) → void -
Available on VN<
Adds all elements from the givenSet< , provided by the BetterSetNotifications extensionT> >valuesto the set. -
clear(
) → void -
Available on VN<
Removes all elements from the set.Set< , provided by the BetterSetNotifications extensionT> > -
firstWhere(
bool function(T function)) → T -
Available on VN<
Returns the first element that satisfies the given predicateSet< , provided by the BetterSetNotifications extensionT> >function. -
hardClear(
) → void -
Available on VN<
Removes all elements from the set and notifies listeners.Set< , provided by the BetterSetNotifications extensionT> > -
hardRemove(
Object? value) → bool -
Available on VN<
Removes the givenSet< , provided by the BetterSetNotifications extensionT> >valuefrom the set and notifies listeners. -
hardRemoveWhere(
bool where(T)) → void -
Available on VN<
Removes all elements from the set that satisfy the predicateSet< , provided by the BetterSetNotifications extensionT> >whereand notifies listeners. -
lastWhere(
bool function(T function)) → T -
Available on VN<
Returns the last element that satisfies the given predicateSet< , provided by the BetterSetNotifications extensionT> >function. -
map<
R> (R map(T e)) → Iterable< R> -
Available on VN<
Transforms the set by applying a function to all its elements.Set< , provided by the BetterSetNotifications extensionT> > -
remove(
Object? value) → bool -
Available on VN<
Removes the givenSet< , provided by the BetterSetNotifications extensionT> >valuefrom the set. -
removeWhere(
bool where(T)) → void -
Available on VN<
Removes all elements from the set that satisfy the given predicateSet< , provided by the BetterSetNotifications extensionT> >where. -
silentAdd(
T value) → bool -
Available on VN<
Adds the givenSet< , provided by the BetterSetNotifications extensionT> >valueto the set without notifying listeners. -
silentAddAll(
Iterable< T> values) → void -
Available on VN<
Adds all elements from the givenSet< , provided by the BetterSetNotifications extensionT> >valuesto the set without notifying listeners. -
silentClear(
) → void -
Available on VN<
Removes all elements from the set without notifying listeners.Set< , provided by the BetterSetNotifications extensionT> > -
silentRemove(
Object? value) → bool -
Available on VN<
Removes the givenSet< , provided by the BetterSetNotifications extensionT> >valuefrom the set without notifying listeners. -
silentRemoveWhere(
bool where(T)) → void -
Available on VN<
Removes all elements from the set that satisfy the predicateSet< , provided by the BetterSetNotifications extensionT> >wherewithout notifying listeners. -
smartAdd(
T value) → bool -
Available on VN<
Adds the givenSet< , provided by the BetterSetNotifications extensionT> >valueto the set and notifies listeners if the value was added. -
smartAddAll(
Iterable< T> values) → void -
Available on VN<
Adds all elements from the givenSet< , provided by the BetterSetNotifications extensionT> >valuesto the set and notifies listeners if the set changed. -
smartClear(
) → void -
Available on VN<
Removes all elements from the set and notifies listeners if the set was not empty.Set< , provided by the BetterSetNotifications extensionT> > -
smartRemove(
Object? value) → bool -
Available on VN<
Removes the givenSet< , provided by the BetterSetNotifications extensionT> >valuefrom the set and notifies listeners if the set changed. -
smartRemoveWhere(
bool where(T)) → void -
Available on VN<
Removes all elements from the set that satisfy the predicateSet< , provided by the BetterSetNotifications extensionT> >where, with behavior determined by ChangeType. -
where(
bool function(T function)) → Iterable< T> -
Available on VN<
Returns a new lazy Iterable with all elements that satisfy the predicateSet< , provided by the BetterSetNotifications extensionT> >function.
Operators
-
operator [](
int index) → T -
Available on VN<
Retrieves the element at the specifiedSet< , provided by the BetterSetNotifications extensionT> >indexin the set.