mediator library

Classes

Host
Class Host handles the registration of widget aspects. And rebuild widgets with aspects when updating.
InheritedMediator
The InheritedModel subclass that is rebuilt by _HostState. The aspect type is always Object.
InheritedMediatorElement
An Element that uses a InheritedMediator as its configuration. Aspect type is always Object.
Rx<T>
Rx
RxImpl<T>
A proxy object class, for variables to turn into a watched one.
Subscriber
A widget class for globalConsumeAll(),/// to register them to the host with all the aspects which has been registered.
SubscriberAuto
A widget class, to register them to the host with aspects.

Extensions

RxExtension on T
Helper for all others type to Rx object.

Properties

globalAllAspects HashSet<Object>
Return all the aspects that has been registered to the Global Mode.
no setter
globalFrameAspects HashSet<Object>
Return the updated aspects of the Global Mode.
no setter
globalPublish PublishFn
no setter

Functions

globalBroadcast() → void
Broadcast to all the consume widgets.
globalConsume(Widget create(), {Key? key}) SubscriberAuto
Create a comsume widget for the watched variable whose value is used inside the widget, and register it to the host to rebuild it when updating the watched variable.
globalConsumeAll(Widget create(), {Key? key}) Subscriber
Create a consume widget that will be rebuilt whenever any watched variables changes are made.
globalGet<T>({Object? tag}) Rx
Retrieve the watched variable by tag or Type of T
globalHost({required Widget child}) Widget
Create a InheritedModel widget to listen to the watched variables and rebuild related consume widgets when updating the watched variable.
globalWatch<T>(T v, {Object? tag}) Rx<T>
Create a watched variable from the variable v, a proxy object of the Type of Rx<T>
ifRxAutoAspectEmpty(List<Object> rxAutoAspectList) bool
Assert rx auto aspect is not empty, i.e. rx automatic aspect is actived.
ifTagMaximum(int rxTagCounter) bool
rx_impl: Assert tag not to exceed maximum.
shouldExists(Object? obj, String errmsg) bool
Assert if obj exists, otherwise throw error message.
shouldNull(Object? obj, String errmsg) bool
Assert if obj not exists, otherwise throw error message.

Typedefs

PublishFn = void Function([Object aspects])
Global area