BroadcastProvider class
Provider of ControlBroadcast.
Global stream to broadcast data and events. Stream is driven by keys and object types.
Default broadcast is created with ControlFactory and is possible to use it via BroadcastProvider.
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
broadcast<
T> ({dynamic key, dynamic value, bool store = false}) → void -
Sends
value
to global object stream. Subs with samekey
andvalue
type will be notified.store
- storesvalue
for future subs and notifies them immediately after subscribe. -
broadcastEvent<
T> ({dynamic key}) → void -
Sends event to global event stream.
Subs with same
key
will be notified. -
subscribe<
T> (dynamic key, ValueChanged< T?> onData) → BroadcastSubscription<T> -
Subscribe to global object stream for given
key
and Type.onData
callback is triggered when broadcast with specifiedkey
and correctvalue
is called.current
when object for givenkey
is stored from previous broadcast, thenonData
is notified immediately. -
subscribeEvent(
dynamic key, VoidCallback callback) → BroadcastSubscription -
Subscribe to global event stream for given
key
.callback
is triggered when broadcast or broadcastEvent with specifiedkey
is called.