ControlBroadcast class
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.
- Inheritance
-
- Object
- ObservableValue
- ObservableModel
- ControlObservable
- ControlBroadcast
- Available Extensions
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- internalData ↔ dynamic
-
getter/setter pairinherited
- isActive → bool
-
no setterinherited
- isEmpty → bool
-
no setterinherited
- isNotEmpty → bool
-
no setterinherited
- isValid → bool
-
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- subCount → int
-
no setterinherited
-
subs
→ List<
ControlSubscription> -
finalinherited
- value ↔ dynamic
-
getter/setter pairinherited
Methods
-
broadcast<
T> ({dynamic key, required dynamic value, bool store = false}) → int -
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}) → int -
Sends event to global event stream.
Subs with same
key
will be notified. -
cancel(
ControlSubscription subscription) → void -
inherited
-
cast<
U> () → ObservableValue< U> -
inherited
-
clear(
) → void -
override
-
createSubscription(
[dynamic args]) → BroadcastSubscription -
override
-
dispose(
) → void -
Used to clear and dispose object.
After this method call is object typically unusable and ready for GC.
Can be called multiple times!
override
-
getStore<
T> (dynamic key) → T? -
Returns stored object by give - exact
key
. Object can be stored during broadcast. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notify(
) → void -
override
-
pause(
) → void -
inherited
-
resume(
) → void -
inherited
-
setValue(
dynamic value, {bool notify = true, bool forceNotify = false}) → void -
inherited
-
subscribe(
ValueCallback action, {bool current = true, dynamic args}) → BroadcastSubscription -
In most of cases not used directly
Check subscribeTo / subscribeOf and subscribeEvent / subscribeEventOf
override
-
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. -
subscribeEventOf<
T> (VoidCallback callback) → BroadcastSubscription -
Subscribe to global event stream for given Type. This Type is used as broadcast
key
.callback
is triggered when broadcast or broadcastEvent with specifiedkey
is called. -
subscribeOf<
T> (ValueChanged< T?> onData, {bool current = true, bool nullOk = true}) → BroadcastSubscription<T> -
Subscribe to global object stream for given Type. This Type is used as broadcast
key
.onData
callback is triggered when broadcast with specifiedkey
and correct value is called.current
when object for givenkey
is stored from previous broadcast, thenonData
is notified immediately. -
subscribeTo<
T> (dynamic key, ValueChanged< T?> onData, {bool current = true, bool nullOk = true}) → BroadcastSubscription<T> -
Subscribe to global object stream for given
key
and Type.onData
callback is triggered when broadcast with specifiedkey
and correct value is called.current
when object for givenkey
is stored from previous broadcast, thenonData
is notified immediately. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited