SetSignalImpl<E> class
Implementation of SetSignal that automatically notifies subscribers when modified.
This is the concrete implementation of the SetSignal interface. SetSignal extends Signal to provide full Set functionality while maintaining reactivity. All set operations (add, remove, clear, etc.) will trigger notifications to subscribers.
See SetSignal for the public interface and usage examples.
Example:
final tags = SetSignal<String>({'dart', 'flutter'});
Effect(() => print('Tags: ${tags.join(', ')} (${tags.length} total)'));
// Prints: "Tags: dart, flutter (2 total)"
tags.add('reactive');
// Prints: "Tags: dart, flutter, reactive (3 total)"
tags.add('dart'); // No change since 'dart' already exists
// No notification triggered
tags.remove('flutter');
// Prints: "Tags: dart, reactive (2 total)"
tags.addAll(['web', 'mobile']);
// Prints: "Tags: dart, reactive, web, mobile (4 total)"
tags.clear();
// Prints: "Tags: (0 total)"
- Inheritance
-
- Object
- ReactiveNode
- SignalReactiveNode<
Set< E> > - SignalImpl<
Set< E> > - SetSignalImpl
- Implemented types
-
- SetSignal<
E>
- SetSignal<
- Mixed-in types
- Available extensions
Constructors
-
SetSignalImpl(Set<
E> ? value, {JoltDebugFn? onDebug}) - Creates a reactive set signal with the given initial set.
Properties
-
cachedValue
↔ Set<
E> ? -
getter/setter pairinherited
- deps ↔ Link?
-
First dependency link in the chain.
getter/setter pairinherited
- depsTail ↔ Link?
-
Last dependency link in the chain.
getter/setter pairinherited
- first → E
-
The first element of the set.
no setterinherited
- firstOrNull → T?
-
Available on Iterable<
The first element of this iterator, orT> , provided by the IterableExtensions extensionnullif the iterable is empty.no setter - flags ↔ int
-
Reactive flags for this node.
getter/setter pairinherited
- hashCode → int
-
The hash code for this object.
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 - isDisposed → bool
-
Whether this node has been disposed.
no setterinherited
- isEmpty → bool
-
Whether this set is empty.
no setterinherited
- isNotEmpty → bool
-
Whether this set is not empty.
no setterinherited
-
iterator
→ Iterator<
E> -
Returns an iterator over the elements of this set.
no setterinherited
- last → E
-
The last element of the set.
no setterinherited
- 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 elements in this set.
no setterinherited
-
nonNulls
→ Iterable<
T> -
Available on Iterable<
The non-T?> , provided by the NullableIterableExtensions extensionnullelements of this iterable.no setter -
peek
→ Set<
E> -
Returns the current value without establishing a reactive dependency.
no setterinherited
-
pendingValue
↔ Set<
E> ? -
getter/setter pairinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- single → E
-
The single element of the set.
no setterinherited
- singleOrNull → T?
-
Available on Iterable<
The single element of this iterator, orT> , provided by the IterableExtensions extensionnull.no setter - subs ↔ Link?
-
First subscriber link in the chain.
getter/setter pairinherited
- subsTail ↔ Link?
-
Last subscriber link in the chain.
getter/setter pairinherited
-
value
↔ Set<
E> -
Returns the current value and establishes a reactive dependency.
getter/setter pairinherited
-
wait
→ Future<
List< T> > -
Available on Iterable<
Waits for futures in parallel.Future< , provided by the FutureIterable extensionT> >no setter
Methods
-
add(
E element) → bool -
Adds the given element to this set.
inherited
-
addAll(
Iterable< E> other) → void -
Adds all elements from the given iterable to this set.
inherited
-
any(
bool test(E element)) → bool -
Returns true if any element satisfies the given test.
inherited
-
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 -
byName(
String name) → T -
Available on Iterable<
Finds the enum value in this list with nameT> , provided by the EnumByName extensionname. -
cast<
R> () → Set< R> -
Returns a view of this set as having
Relements.inherited -
clear(
) → void -
Removes all elements from the set.
inherited
-
contains(
Object? element) → bool -
Returns true if the set contains the given element.
inherited
-
containsAll(
Iterable< Object?> other) → bool -
Returns true if this set contains all elements in
other.inherited -
difference(
Set< Object?> other) → Set<E> -
Returns a new set with elements in this set that are not in
other.inherited -
dispose(
) → void -
Disposes this node and cleans up resources.
inherited
-
elementAt(
int index) → E -
Returns the element at the given index.
inherited
-
elementAtOrNull(
int index) → T? -
Available on Iterable<
The element at positionT> , provided by the IterableExtensions extensionindexof this iterable, ornull. -
every(
bool test(E element)) → bool -
Returns true if every element satisfies the given test.
inherited
-
expand<
R> (Iterable< R> f(E element)) → Iterable<R> -
Expands each element into zero or more elements.
inherited
-
firstWhere(
bool test(E element), {E orElse()?}) → E -
Returns the first element that satisfies the given test.
inherited
-
fold<
T> (T initialValue, T combine(T previousValue, E element)) → T -
Reduces the set to a single value by iteratively combining elements.
inherited
-
followedBy(
Iterable< E> other) → Iterable<E> -
Returns an iterable of this set followed by
other.inherited -
forEach(
void action(E element)) → void -
Applies the given function to each element in the set.
inherited
-
get(
) → Set< E> -
Returns the current value and establishes a reactive dependency.
inherited
-
intersection(
Set< Object?> other) → Set<E> -
Returns a new set containing elements present in both this set and
other.inherited -
join(
[String separator = ""]) → String -
Joins all elements into a string separated by
separator.inherited -
lastWhere(
bool test(E element), {E orElse()?}) → E -
Returns the last element that satisfies the given test.
inherited
-
lookup(
Object? element) → E? -
Returns the element equal to
element, if present.inherited -
map<
T> (T f(E element)) → Iterable< T> -
Returns an iterable with elements transformed by the given function.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notify(
) → void -
Manually notifies all subscribers that this signal has changed.
inherited
-
onDispose(
) → void -
Disposes the signal and cleans up resources.
inherited
-
reduce(
E combine(E value, E element)) → E -
Reduces the set to a single value using the given combine function.
inherited
-
remove(
Object? element) → bool -
Removes the given element from the set.
inherited
-
removeAll(
Iterable< Object?> other) → void -
Removes all elements in
otherfrom this set.inherited -
removeWhere(
bool test(E element)) → void -
Removes all elements that satisfy the given test.
inherited
-
retainAll(
Iterable< Object?> other) → void -
Removes all elements not in
otherfrom this set.inherited -
retainWhere(
bool test(E element)) → void -
Removes all elements that do not satisfy the given test.
inherited
-
set(
Set< E> value) → Set<E> -
Sets a new value for the signal and notifies subscribers when it changes.
inherited
-
singleWhere(
bool test(E element), {E orElse()?}) → E -
Returns the single element that satisfies the given test.
inherited
-
skip(
int n) → Iterable< E> -
Returns an iterable that skips the first
nelements.inherited -
skipWhile(
bool test(E element)) → Iterable< E> -
Returns an iterable that skips elements while
testreturns true.inherited -
take(
int count) → Iterable< E> -
Returns an iterable with at most
countelements.inherited -
takeWhile(
bool test(E element)) → Iterable< E> -
Returns an iterable that takes elements while
testreturns true.inherited -
toIterableSignal(
) → IterableSignal< E> -
Available on Iterable<
Converts this iterable to a reactive iterable signal.E> , provided by the JoltIterableExtension extension -
toList(
{bool growable = true}) → List< E> -
Returns a list containing the elements of this set.
inherited
-
toSet(
) → Set< E> -
Returns a new set containing the same elements as this set.
inherited
-
toSetSignal(
) → SetSignal< E> -
Available on Set<
Converts this set to a reactive set signal.E> , provided by the JoltSetExtension extension -
toString(
) → String -
A string representation of this object.
inherited
-
union(
Set< E> other) → Set<E> -
Returns a new set containing all elements in this set and
other.inherited -
where(
bool test(E element)) → Iterable< E> -
Returns an iterable containing elements that satisfy the given test.
inherited
-
whereType<
T> () → Iterable< T> -
Returns an iterable containing only elements of type
T.inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited