LxSet<E> class
A reactive set that automatically notifies observers when elements are added or removed.
LxSet implements the standard Dart Set interface and provides automatic reactivity for all mutating operations.
- Inheritance
- Implemented types
-
- Set<
E>
- Set<
- Available extensions
Constructors
Properties
- first → E
-
The first element.
no setteroverride
- firstOrNull → T?
-
Available on Iterable<
The first element of this iterator, orT> , provided by the IterableExtensions extensionnullif the iterable is empty.no setter - graphDepth ↔ int
-
Returns the current depth in the dependency graph.
getter/setter pairinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListener → bool
-
Whether there are active listeners.
no setterinherited
- id → int
-
A unique runtime identifier for this reactive instance.
finalinherited
-
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 the reactive object has been closed/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 set.
no setteroverride
- last → E
-
The last element.
no setteroverride
- 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 Iterable.
no setteroverride
-
lx
→ LxSet<
E> -
Available on Set<
Wraps this set in a reactive LxSet.E> , provided by the LxSetExtension extensionno setter - name ↔ String?
-
An optional descriptive name for debugging and profiling.
getter/setter pairinherited
-
nonNulls
→ Iterable<
T> -
Available on Iterable<
The non-T?> , provided by the NullableIterableExtensions extensionnullelements of this iterable.no setter - onCancel → void Function()?
-
Called when the stream is cancelled.
finalinherited
- onListen → void Function()?
-
Called when the stream is listened to.
finalinherited
- ownerId ↔ String?
-
The registration key of the owning controller, if applicable.
getter/setter pairinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- single → E
-
Checks that this iterable has only one element, and returns that element.
no setteroverride
- singleOrNull → T?
-
Available on Iterable<
The single element of this iterator, orT> , provided by the IterableExtensions extensionnull.no setter -
stream
→ Stream<
Set< E> > -
A Stream that emits the latest value whenever it updates.
no setterinherited
-
value
↔ Set<
E> -
The current state of the reactive object.
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 value) → bool -
Adds
valueto the set.override -
addAll(
Iterable< E> elements) → void -
Adds all
elementsto this set.override -
addListener(
void listener()) → void -
Adds a listener.
inherited
-
any(
bool test(E)) → bool -
Checks whether any element of this iterable satisfies
test.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 -
assign(
Iterable< E> elements) → void -
Replaces all elements with
elementsin a single notification. -
assignOne(
E element) → void -
Replaces the set with a single
element. -
bind(
Stream< Set< externalStream) → voidE> > -
Binds an external stream to this reactive variable.
inherited
-
byName(
String name) → T -
Available on Iterable<
Finds the enum value in this list with nameT> , provided by the EnumByName extensionname. -
call(
[Set< E> ? v]) → Set<E> -
Functional-style update and retrieval.
inherited
-
cast<
R> () → Set< R> -
Provides a view of this set as a set of
Rinstances.override -
clear(
) → void -
Removes all elements from the set.
override
-
close(
) → void -
Permanently closes the reactive object and releases all internal resources.
inherited
-
contains(
Object? value) → bool -
Whether
valueis in the set.override -
containsAll(
Iterable< Object?> other) → bool -
Whether this set contains all the elements of
other.override -
difference(
Set< Object?> other) → Set<E> -
Creates a new set with the elements of this that are not in
other.override -
dispose(
) → void -
Disposes the notifier.
inherited
-
elementAt(
int index) → E -
Returns the
indexth element.override -
elementAtOrNull(
int index) → T? -
Available on Iterable<
The element at positionT> , provided by the IterableExtensions extensionindexof this iterable, ornull. -
every(
bool test(E)) → bool -
Checks whether every element of this iterable satisfies
test.override -
expand<
T> (Iterable< T> f(E)) → Iterable<T> -
Expands each element of this Iterable into zero or more elements.
override
-
firstWhere(
bool test(E), {E orElse()?}) → E -
The first element that satisfies the given predicate
test.override -
fold<
T> (T initialValue, T combine(T, E)) → T -
Reduces a collection to a single value by iteratively combining each
element of the collection with an existing value
override
-
followedBy(
Iterable< E> other) → Iterable<E> -
Creates the lazy concatenation of this iterable and
other.override -
forEach(
void f(E)) → void -
Invokes
actionon each element of this iterable in iteration order.override -
intersection(
Set< Object?> other) → Set<E> -
Creates a new set which is the intersection between this set and
other.override -
join(
[String separator = '']) → String -
Converts each element to a String and concatenates the strings.
override
-
lastWhere(
bool test(E), {E orElse()?}) → E -
The last element that satisfies the given predicate
test.override -
lookup(
Object? object) → E? -
If an object equal to
objectis in the set, return it.override -
map<
T> (T f(E)) → Iterable< T> -
The current elements of this iterable modified by
toElement.override -
mutate(
void mutator(Set< E> value)) → void -
Mutates the value in place and triggers a refresh.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notify(
) → void -
Alias for refresh.
inherited
-
reduce(
E combine(E, E)) → E -
Reduces a collection to a single value by iteratively combining elements
of the collection using the provided function.
override
-
refresh(
) → void -
Triggers a notification without changing the value.
inherited
-
remove(
Object? value) → bool -
Removes
valuefrom the set.override -
removeAll(
Iterable< Object?> elements) → void -
Removes each element of
elementsfrom this set.override -
removeListener(
void listener()) → void -
Removes a listener.
inherited
-
removeWhere(
bool test(E)) → void -
Removes all elements of this set that satisfy
test.override -
retainAll(
Iterable< Object?> elements) → void -
Removes all elements of this set that are not elements in
elements.override -
retainWhere(
bool test(E)) → void -
Removes all elements of this set that fail to satisfy
test.override -
setValueInternal(
Set< E> val, {bool notifyListeners = true}) → void -
Internal setter for subclasses (Computed, etc.)
inherited
-
singleWhere(
bool test(E), {E orElse()?}) → E -
The single element that satisfies
test.override -
skip(
int count) → Iterable< E> -
Creates an Iterable that provides all but the first
countelements.override -
skipWhile(
bool test(E)) → Iterable< E> -
Creates an
Iterablethat skips leading elements whiletestis satisfied.override -
take(
int count) → Iterable< E> -
Creates a lazy iterable of the
countfirst elements of this iterable.override -
takeWhile(
bool test(E)) → Iterable< E> -
Creates a lazy iterable of the leading elements satisfying
test.override -
toList(
{bool growable = true}) → List< E> -
Creates a List containing the elements of this Iterable.
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
-
transform<
R> (Stream< R> transformer(Stream<Set< stream)) → LxStream<E> >R> -
Transforms the stream of changes using
transformer.inherited -
unbind(
) → void -
Unbinds any external stream.
inherited
-
union(
Set< E> other) → Set<E> -
Creates a new set which contains all the elements of this set and
other.override -
updateValue(
Set< E> fn(Set<E> val)) → void -
Updates the value using a transformation function.
inherited
-
where(
bool test(E)) → 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