TimestampBeacon<T> class
A beacon that attaches a timestamp to its value.
- Inheritance
-
- Object
- Producer<
TimestampValue< T> > - ReadableBeacon<
TimestampValue< T> > - TimestampBeacon
Constructors
- TimestampBeacon({T? initialValue, String? name})
- @macro TimestampBeacon
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
→ TimestampValue<
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
→ TimestampValue<
T> ? -
The previous value of the beacon.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
stream
→ Stream<
TimestampValue< T> > -
Returns a broadcast Stream that emits the current value
and all subsequent updates to the value of this beacon.
no setterinherited
-
value
→ TimestampValue<
T> -
Returns the current value and subscribes to changes in the beacon
when used within a
Beacon.effectorBeacon.derived.no setterinherited
Methods
-
call(
) → TimestampValue< 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.
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(
) → TimestampValue< T> -
Return the current value of the beacon without subscribing to it.
inherited
-
set(
T newValue) → void - Set the value of this beacon.
-
subscribe(
void callback(TimestampValue< 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< TimestampValue< T> > -
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
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited