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
length
changes 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.effect
orBeacon.derived
.getter/setter pairinherited
Methods
-
add(
E value) → void -
Adds
value
to the end of this list, extending the length by one. -
addAll(
Iterable< E> iterable) → void -
Appends all objects of
iterable
to 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
. -
insert(
int index, E element) → void -
Inserts
element
at positionindex
in this list. -
insertAll(
int index, Iterable< E> iterable) → void -
Inserts all objects of
iterable
at positionindex
in 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
value
from this list. -
removeAt(
int index) → E -
Removes the object at position
index
from 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
iterable
into 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
compare
function. -
subscribe(
void callback(List< E> ), {bool startNow = true, bool synchronous = false}) → VoidCallback -
Subscribes to changes in the beacon
returns a function that can be called to unsubscribe
inherited
-
toStream(
{bool synchronous = false}) → Stream< List< E> > -
Returns a broadcast Stream that emits the current value
and all subsequent updates to the value of this beacon.
If
synchronous
is true,autobatching
will be disabled and all updates will be emitted immediately.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
index
in the list tovalue
.