ContextProviderMixin mixin

获取BuildContext的Mixin

为ViewModel提供获取上下文的能力

Superclass constraints
Mixin applications

Properties

context BuildContext?
获取上下文
no setter
contextStream Stream<BuildContext?>
上下文变化的流
no setter
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

configByViewModel<T extends ViewModel>(ValueChanged<T> onConfig, {bool listen = false}) StreamSubscription<T>
只获取一次ViewModel,可以用来在其中做一些配置 返回的 StreamSubscription 需要调用 dispose 进行清理。
dispose() → void
override
getViewModel<T extends ViewModel>({bool listen = false}) Stream<T>
BuildContext变化重新获取对应类型的ViewModel
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
updateContext(BuildContext context) → void

Operators

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