flowr_mvvm
library
Classes
BaseFlowR <T >
DisposeMethod
marks an instance method as a dispose
call back to be passed to GetIt
Environment
Used to annotate dependencies which are
registered under certain environments
EnvironmentFilter
a simple filter function to be used inside SimpleEnvironmentFilter
filter for whether to register for the given set of environments
clients can extend this class to maker
their own environmentFilters
ExternalModule
FactoryMethod
Marks a factory, a named constructor or a static create
function as an injectable constructor
if not added the default constructor will be used
FactoryParam
Marks a constructor param as
factoryParam so it can be passed
to the resolver function
FlowR <T >
开箱即用的 FlowR基类
FrConsumer <VM extends FrViewModel <M > , M extends dynamic >
FrFutureBuilder <VM extends FrViewModel >
FrListener <VM extends FrViewModel <M > , M extends dynamic >
FrMultiProvider
FrProvider <VM extends FrService >
auto dispose FrViewModel
FrService
FrService
FrSnap <VM extends FrViewModel , M >
FrStreamBuilder <VM extends FrViewModel , T extends dynamic >
FrView <VM extends FrViewModel <M > , M extends dynamic >
FrViewFutureBuilder <VM extends FrViewModel , M extends dynamic >
FrViewModel <M extends dynamic >
GetIt
Very simple and easy to use service locator
You register your object creation factory or an instance of an object with registerFactory ,
registerSingleton or registerLazySingleton
And retrieve the desired object using get or call your locator as function as its a
callable class
Additionally GetIt offers asynchronous creation functions as well as functions to synchronize
the async initialization of multiple Singletons
GetItHelper
a helper class to handle conditional registering
IgnoreParam
Constructor params annotated with IgnoreParam
will be ignored by when generating the
resolver function
Injectable
Marks a class as an injectable
dependency and generates
InjectableInit
// Marks a top-level function as an initializer function
for configuring Get_it
IService
service
LazySingleton
Classes annotated with @LazySingleton
will generate registerLazySingleton func
Level
Level s to control logging output. Logging can be enabled to include all
levels above certain Level . Level s are ordered using an integer
value Level.value . The predefined Level constants below are sorted as
follows (in descending order): Level.SHOUT , Level.SEVERE ,
Level.WARNING , Level.INFO , Level.CONFIG , Level.FINE , Level.FINER ,
Level.FINEST , and Level.ALL .
tp
null: not print log extra info (dev tips, stack, ...)
inner : last FlowR method
- This is where you call the ::logger
self : (dft) last your CustomViewModel(or other class) method
- This is where you call the ::update
outer : invoke FlowR method at log.name
- This is where you call the method that contains the ::update method
all : for dev, print all stack frame info
Logger
Use a Logger to log debug messages.
LogRecord
A log entry representation used to propagate information from Logger to
individual handlers.
MicroPackageModule
ModelSnapshot <VM extends FrViewModel , T >
Module
marks a class as a register module where all
property accessors rerun types are considered factories
unless annotated with @singleton/lazySingleton.
Named
Used to register a dependency under a name
instead of type also used to annotated
named injected dependencies in constructors
NoEnvOrContains
This filter validates dependencies with no environment
keys or contain the provided environment
NoEnvOrContainsAll
This filter validates dependencies with no environment
keys, or the ones containing all the provided environments
NoEnvOrContainsAny
This filter validates dependencies with no environment
keys, or the ones containing one of the provided environments
Order
Classes annotated with @Order will overwrite
the automatically generated position of the
PostConstruct
methods annotated with postConstruct
will be called in a cascade manner
after being constructed
PreResolve
Futures annotated with preResolve
will be pre-awaited before they're
registered inside of GetIt
Provider <T >
A Provider that manages the lifecycle of the value it provides by
delegating to a pair of Create and Dispose .
Rx
A utility class that provides static methods to create the various Streams
provided by RxDart.
Scope
Used to annotate dependencies which are
registered under a different scope than main-scope
SimpleEnvironmentFilter
A simple filter that can be used directly for simple use cases
without having to extend the base EnvironmentFilter
Singleton
Classes annotated with @Singleton
will generate registerSingleton function
StreamController <T >
A controller with the stream it controls.
StreamSubscription <T >
A subscription on events from a Stream .
ValueStream <T >
An Stream that provides synchronous access to the last emitted item
Zone
A zone represents an environment that remains stable across asynchronous
calls.
Typedefs
EnvironmentFilterFunc
= bool Function(Set <String > )
FrModel
= dynamic
FrViewBuilder <VM extends FrViewModel , M >
= Widget Function(BuildContext context , FrSnap <VM , M > s , Widget ? child )
FrWidgetBuilder <VM extends FrViewModel , M >
= Widget Function(BuildContext c , ModelSnapshot <VM , M > s )
FrWidgetListener <VM , M >
= void Function(BuildContext context , M previous , M current , VM vm )
OnLogging <T >
= String Function(T prv , T cur ) ?
FlowR
--- Basic mixin ---
FlowrMx 核心基础功能: 使用Stream传递数据
UpdatableMx 提供 update 方法, 自动捕获异常
LoggableMx 打印putError的异常于StackTrace
before invoke FlowRMx.put , build log content