mediator library

Classes

Host
Class Host handles the registration of consume widget with [aspects, and rebuild consume widgets with aspects when updating.
InheritedMediator
An InheritedModel subclass that is rebuilt by _HostState. Aspect type always is Object.
InheritedMediatorElement
An Element that uses a InheritedMediator as its configuration. Aspect type always is Object.
Rx<T>
Rx
RxImpl<T>
A proxy object class, for variables to turn into a watched one.
RxPersistBase<T>
RxPersistBool
Rx persistent class for bool Type.
RxPersistDouble
Rx persistent class for double Type.
RxPersistInt
Rx persistent class for int Type.
RxPersistString
Rx persistent class for String Type.
RxPersistStringList
Rx persistent class for List<String> Type.
Subscriber
The consume widget class
SubscriberAuto
The consume widget class with automatic aspect management.

Extensions

RxExtension on T
Extension for all others type to Rx object.
RxPersistBoolExtension on bool
Extension for bool type to Rx persistent class.
RxPersistDoubleExtension on double
Extension for double type to Rx persistent class.
RxPersistIntExtension on int
Extension for int type to Rx persistent class.
RxPersistStringExtension on String
Extension for String type to Rx persistent class.
RxPersistStringListExtension on List<String>
Extension for List

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

getPersistStore() → SharedPreferences
Return the backend persistent storage, a SharedPreferences instance.
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 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.
initGlobal(Widget child) Future<void>
Initial the most common case main(), with the [child] widget, e.g.
initGlobalPersist() Future<void>
Initial the persistent storage.
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