MapBeacon<K, V> class
A beacon that holds a map of values.
- Inheritance
-
- Object
- Producer<
Map< K, V> > - ReadableBeacon<
Map< K, V> > - WritableBeacon<
Map< K, V> > - MapBeacon
Properties
-
$$widgetSubscribers$$
→ Set<
int> -
The hashcode of all widgets subscribed to this beacon.
This should not be used directly.
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
-
initialValue
→ Map<
K, V> -
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
- 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
→ Map<
K, V> ? -
The previous value of the beacon.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
stream
→ Stream<
Map< K, V> > -
Returns a broadcast Stream that emits the current value
and all subsequent updates to the value of this beacon.
no setterinherited
-
value
↔ Map<
K, V> -
Returns the current value and subscribes to changes in the beacon
when used within a
Beacon.effectorBeacon.derived.getter/setter pairinherited
Methods
-
addAll(
Map< K, V> other) → void -
Adds all key/value pairs of
otherto this map. -
call(
) → Map< K, V> -
Equivalent to calling value getter.
inherited
-
clear(
) → void - Removes all entries from the map.
-
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
-
guard(
) → void -
Prevents the beacon from being disposed by its dependants.
The beacon will still be disposed if its dependencies are disposed.
inherited
-
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(
) → Map< K, V> -
Return the current value of the beacon without subscribing to it.
inherited
-
putIfAbsent(
K key, V ifAbsent()) → V? -
Look up the value of
key, or add a new entry if it isn't there. -
remove(
Object? key) → V? -
Removes
keyand its associated value, if present, from the map. -
removeWhere(
bool predicate(K key, V value)) → void -
Removes all entries of this map that satisfy the given
predicate. -
reset(
{bool force = false}) → void -
Clears the map
override
-
set(
Map< K, V> newValue, {bool force = false}) → void -
Sets the value of the beacon and allows a force notification
inherited
-
subscribe(
void callback(Map< K, V> ), {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< Map< K, V> > -
Returns a broadcast Stream that emits the current value
and all subsequent updates to the value of this beacon.
If
synchronousis true,autobatchingwill be disabled and all updates will be emitted immediately.inherited -
toString(
) → String -
A string representation of this object.
inherited
-
update(
K key, V update(V value), {V ifAbsent()?}) → void -
Updates the value for the provided
key. -
updateAll(
V update(K key, V value)) → void - Updates all values.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
-
operator [](
Object? key) → V? -
The value for the given
key, ornullifkeyis not in the map. -
operator []=(
K key, V value) → void -
Associates the
keywith the givenvalue.