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.
on

Properties

first → T

Available on VN<Set<T>>, provided by the BetterSetNotifications extension

Returns the first element in the set.
no setter
firstOrNull → T?

Available on VN<Set<T>>, provided by the BetterSetNotifications extension

Returns the first element in the set, or null if the set is empty.
no setter
isEmpty bool

Available on VN<Set<T>>, provided by the BetterSetNotifications extension

Returns true if the set has no elements.
no setter
isNotEmpty bool

Available on VN<Set<T>>, provided by the BetterSetNotifications extension

Returns true if the set has one or more elements.
no setter
last → T

Available on VN<Set<T>>, provided by the BetterSetNotifications extension

Returns the last element in the set.
no setter
lastOrNull → T?

Available on VN<Set<T>>, provided by the BetterSetNotifications extension

Returns the last element in the set, or null if the set is empty.
no setter
length int

Available on VN<Set<T>>, provided by the BetterSetNotifications extension

Returns the number of elements in the set.
no setter

Methods

add(T value) bool

Available on VN<Set<T>>, provided by the BetterSetNotifications extension

Adds the given value to the set.
addAll(Iterable<T> values) → void

Available on VN<Set<T>>, provided by the BetterSetNotifications extension

Adds all elements from the given values to the set.
clear() → void

Available on VN<Set<T>>, provided by the BetterSetNotifications extension

Removes all elements from the set.
firstWhere(bool function(T function)) → T

Available on VN<Set<T>>, provided by the BetterSetNotifications extension

Returns the first element that satisfies the given predicate function.
hardClear() → void

Available on VN<Set<T>>, provided by the BetterSetNotifications extension

Removes all elements from the set and notifies listeners.
hardRemove(Object? value) bool

Available on VN<Set<T>>, provided by the BetterSetNotifications extension

Removes the given value from the set and notifies listeners.
hardRemoveWhere(bool where(T)) → void

Available on VN<Set<T>>, provided by the BetterSetNotifications extension

Removes all elements from the set that satisfy the predicate where and notifies listeners.
lastWhere(bool function(T function)) → T

Available on VN<Set<T>>, provided by the BetterSetNotifications extension

Returns the last element that satisfies the given predicate function.
map<R>(R map(T e)) Iterable<R>

Available on VN<Set<T>>, provided by the BetterSetNotifications extension

Transforms the set by applying a function to all its elements.
remove(Object? value) bool

Available on VN<Set<T>>, provided by the BetterSetNotifications extension

Removes the given value from the set.
removeWhere(bool where(T)) → void

Available on VN<Set<T>>, provided by the BetterSetNotifications extension

Removes all elements from the set that satisfy the given predicate where.
silentAdd(T value) bool

Available on VN<Set<T>>, provided by the BetterSetNotifications extension

Adds the given value to the set without notifying listeners.
silentAddAll(Iterable<T> values) → void

Available on VN<Set<T>>, provided by the BetterSetNotifications extension

Adds all elements from the given values to the set without notifying listeners.
silentClear() → void

Available on VN<Set<T>>, provided by the BetterSetNotifications extension

Removes all elements from the set without notifying listeners.
silentRemove(Object? value) bool

Available on VN<Set<T>>, provided by the BetterSetNotifications extension

Removes the given value from the set without notifying listeners.
silentRemoveWhere(bool where(T)) → void

Available on VN<Set<T>>, provided by the BetterSetNotifications extension

Removes all elements from the set that satisfy the predicate where without notifying listeners.
smartAdd(T value) bool

Available on VN<Set<T>>, provided by the BetterSetNotifications extension

Adds the given value to the set and notifies listeners if the value was added.
smartAddAll(Iterable<T> values) → void

Available on VN<Set<T>>, provided by the BetterSetNotifications extension

Adds all elements from the given values to the set and notifies listeners if the set changed.
smartClear() → void

Available on VN<Set<T>>, provided by the BetterSetNotifications extension

Removes all elements from the set and notifies listeners if the set was not empty.
smartRemove(Object? value) bool

Available on VN<Set<T>>, provided by the BetterSetNotifications extension

Removes the given value from the set and notifies listeners if the set changed.
smartRemoveWhere(bool where(T)) → void

Available on VN<Set<T>>, provided by the BetterSetNotifications extension

Removes all elements from the set that satisfy the predicate where, with behavior determined by ChangeType.
where(bool function(T function)) Iterable<T>

Available on VN<Set<T>>, provided by the BetterSetNotifications extension

Returns a new lazy Iterable with all elements that satisfy the predicate function.

Operators

operator [](int index) → T

Available on VN<Set<T>>, provided by the BetterSetNotifications extension

Retrieves the element at the specified index in the set.