Producer<T> class abstract

The base class for all beacons.

Implemented types
Implementers
Available extensions

Constructors

Producer({T? initialValue, String? name})
Creates a new Producer.

Properties

$$widgetSubscribers$$ → Set<int>
The hashcode of all widgets subscribed to this beacon. This should not be used directly.
final
hashCode → int
The hash code for this object.
no setterinherited
initialValue → T
The initial value of the beacon.
no setter
isDisposed → bool
Returns true if the beacon has been disposed.
no setter
isEmpty → bool
Returns true if the beacon has not been initialized.
no setter
listenersCount → int
The number of listeners subscribed to this beacon.
no setter
name → String
The name of the beacon. For debugging purposes.
no setter
previousValue → T?
The previous value of the beacon.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
value → T
Returns the current value and subscribes to changes in the beacon when used within a Beacon.effect or Beacon.derived.
no setter

Methods

call() → T
Equivalent to calling value getter.
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
guard() → void
Prevents the beacon from being disposed by its dependants. The beacon will still be disposed if its dependencies are disposed.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
observe(BuildContext context, ObserverCallback<T> callback) → void

Available on BaseBeacon<T>, provided by the WidgetUtils extension

Observes the state of a beacon and triggers a callback with the current state.
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.
peek() → T
Return the current value of the beacon without subscribing to it.
subscribe(void callback(T), {bool startNow = true}) → VoidCallback
Subscribes to changes in the beacon returns a function that can be called to unsubscribe
toString() → String
A string representation of this object.
override
watch(BuildContext context) → T

Available on BaseBeacon<T>, provided by the WidgetUtils extension

Watches a beacon and triggers a widget rebuild when its value changes.

Operators

operator ==(Object other) → bool
The equality operator.
inherited