FlowR<T> class abstract

FlowR --- Basic mixin --- BaseFlowR 核心基础功能: 使用Stream传递数据 UpdatableMx 提供 update 方法, 自动捕获异常 LoggableMx 打印putError的异常于StackTrace

开箱即用的 FlowR基类

注意:

  • 不要在FlowR内部存储任何状态数据: 而应该在Tvalue中存储, tag 代表Tvalue(Model)的实例, 而非FlowR (ViewModel)的实例
Inheritance
Mixed-in types

Constructors

FlowR()

Properties

hashCode int
The hash code for this object.
no setterinherited
initValue → T
initValue can not be null;
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
slowly → Slowly<Object>
no setterinherited
stream ValueStream<T>
get value's stream
no setteroverride
subject → BehaviorSubject<T>
core stream controller
no setter
value → T
get current value
no setteroverride
valueOrNull → T?
no setter

Methods

autoDispose<T extends StreamSubscription?>(T subs, {String? tag}) → T
inherited
debounceMs<R>(Object tag, R func, {int ms = 200}) Future<R?>
inherited
dispose() → void
override
frPrint(String message, {DateTime? time, int? sequenceNumber, int? level, String? name, Zone? zone, Object? error, StackTrace? stackTrace}) → dynamic
inherited
logger(String message, {LogExtra? logExtra, bool uriFrame = false, DateTime? time, int? sequenceNumber, int level = 0, String? name, Zone? zone, Object? error, StackTrace? stackTrace}) → dynamic
logExtra print stack frame info; (at log.name) uriFrame show logExtra uri; (at log.message)
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
put(T value) → T
put new value
override
putError(Object error, [StackTrace? stackTrace]) → void
put new error
override
runCatching<R>(FutureOr<R> block(), {FutureOr<R?> onSuccess(R data)?, FutureOr<R?> onFailure(Object e, StackTrace s)?, dynamic ignoreSkipError = true}) FutureOr<R?>
ignoreSkipError true: SkipError will not trigger onFailure when true
inherited
skp(String msg) SkipError
SkipError
inherited
subBy<T extends StreamSubscription>(String tag) → T
inherited
toString() String
A string representation of this object.
inherited
update(FutureOr<T> update(T old), {dynamic onError(Object e, StackTrace s)?, int slowlyMs = 100, Object? debounceTag, Object? throttleTag}) Future<void>
执行一个异步操作, 并更新状态 不建议对本方法进行二次包装, 因此返回值强制为 void
inherited
updateOrNull(FutureOr<T> update(T? old), {dynamic onError(Object e, StackTrace s)?}) FutureOr<void>
if State init value is null, you can use updateOrNull
updateRaw(FutureOr<T?> update(T old), {dynamic onError(Object e, StackTrace s)?, int slowlyMs = 100, Object? debounceTag, Object? throttleTag, dynamic ignoreSkipError = true}) FutureOr<T?>
for advance user you can sync update value, and get the return value update if return value, will call put if return null, will not call put/putError onError if set null,will call putError if set function value, will not call putError, you can invoke putError manually slowlyMs if set <=0 value, will ignore debounce/throttleTag debounceTag enable debounce, require unique within the VM scope throttleTag enable throttle, require unique within the VM scope ignoreSkipError ref runCatching.ignoreSkipError
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited