ListBeacon<E> class
A beacon that holds a list of values.
- Inheritance
-
- Object
- Producer<
List< E> > - ReadableBeacon<
List< E> > - WritableBeacon<
List< E> > - ListBeacon
Constructors
-
ListBeacon(List<
E> initialValue, {String? name}) - @macro ListBeacon
Properties
-
$$widgetSubscribers$$
→ Set<
int> -
The hashcode of all widgets subscribed to this beacon.
This should not be used directly.
finalinherited
- first ← E
-
Set the first element of the list.
no getter
- hashCode → int
-
The hash code for this object.
no setterinherited
-
initialValue
→ List<
E> -
The initial value of the beacon.
no setterinherited
- isDisposed → bool
-
Returns true if the beacon has been disposed.
no setterinherited
- isEmpty → bool
-
Returns true if the beacon has not been initialized.
no setterinherited
- last ← E
-
Set the last element of the list.
no getter
- length ← int
-
Setting the
lengthchanges the number of elements in the list.no getter - listenersCount → int
-
The number of listeners subscribed to this beacon.
no setterinherited
- name → String
-
The name of the beacon. For debugging purposes.
no setterinherited
-
previousValue
→ List<
E> ? -
The previous value of the beacon.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
stream
→ Stream<
List< E> > -
Returns a broadcast Stream that emits the current value
and all subsequent updates to the value of this beacon.
no setterinherited
-
value
↔ List<
E> -
Returns the current value and subscribes to changes in the beacon
when used within a
Beacon.effectorBeacon.derived.getter/setter pairinherited
Methods
-
add(
E value) → void -
Adds
valueto the end of this list, extending the length by one. -
addAll(
Iterable< E> iterable) → void -
Appends all objects of
iterableto the end of this list. -
call(
) → List< E> -
Equivalent to calling value getter.
inherited
-
clear(
) → void - Removes all objects from this list; the length of the list becomes zero.
-
clearWrapped(
) → void -
Disposes all currently wrapped beacons
inherited
-
dispose(
) → void -
Clears all registered listeners and
resouces used by the beacon. You will
not be able to update or subscribe to
the beacon after it has been disposed.
inherited
-
fillRange(
int start, int end, [E? fillValue]) → void -
Overwrites a range of elements with
fillValue. -
guard(
) → void -
Prevents the beacon from being disposed by its dependants.
The beacon will still be disposed if its dependencies are disposed.
inherited
-
insert(
int index, E element) → void -
Inserts
elementat positionindexin this list. -
insertAll(
int index, Iterable< E> iterable) → void -
Inserts all objects of
iterableat positionindexin this list. -
mapInPlace(
E toElement(E)) → void - Like List.map, but updates the list in place.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onDispose(
VoidCallback callback) → VoidCallback -
Registers a callback to be called when the beacon is disposed.
Returns a function that can be called to remove the callback.
inherited
-
peek(
) → List< E> -
Return the current value of the beacon without subscribing to it.
inherited
-
remove(
Object? value) → bool -
Removes the first occurrence of
valuefrom this list. -
removeAt(
int index) → E -
Removes the object at position
indexfrom this list. -
removeLast(
) → E - Removes and returns the last object in this list.
-
removeRange(
int start, int end) → void - Removes a range of elements from the list.
-
removeWhere(
bool test(E element)) → void -
Removes all objects from this list that satisfy
test. -
replaceRange(
int start, int end, Iterable< E> replacements) → void -
Replaces a range of elements with the elements of
replacements. -
reset(
{bool force = false}) → void -
Clears the list
override
-
retainWhere(
bool test(E element)) → void -
Removes all objects from this list that fail to satisfy
test. -
set(
List< E> newValue, {bool force = false}) → void -
Sets the value of the beacon and allows a force notification
inherited
-
setAll(
int index, Iterable< E> iterable) → void -
Overwrites elements with the objects of
iterable. -
setRange(
int start, int end, Iterable< E> iterable, [int skipCount = 0]) → void -
Writes some elements of
iterableinto a range of this list. -
shuffle(
[Random? random]) → void - Shuffles the elements of this list randomly.
-
sort(
[int compare(E a, E b)?]) → void -
Sorts this list according to the order
specified by the
comparefunction. -
subscribe(
void callback(List< E> ), {bool startNow = true}) → VoidCallback -
Subscribes to changes in the beacon
returns a function that can be called to unsubscribe
inherited
-
subscribeSynchronously(
void callback(List< E> ), {bool startNow = true}) → VoidCallback -
Subscribes to changes in the beacon
returns a function that can be called to unsubscribe
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
-
operator []=(
int index, E value) → void -
Sets the value at the given
indexin the list tovalue.