ReadableBeacon<T> class
An immutable beacon.
- Inheritance
- Available extensions
Constructors
- ReadableBeacon({T? initialValue, String? name})
- @macro ReadableBeacon
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 → T
-
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 → T?
-
The previous value of the beacon.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
stream
→ Stream<
T> -
Returns a broadcast Stream that emits the current value
and all subsequent updates to the value of this beacon.
no setter
- value → T
-
Returns the current value and subscribes to changes in the beacon
when used within a
Beacon.effect
orBeacon.derived
.no setterinherited
Methods
-
call(
) → T -
Equivalent to calling value getter.
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.
override
-
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(
) → T -
Return the current value of the beacon without subscribing to it.
inherited
-
subscribe(
void callback(T), {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< T> -
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. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited