ViewModel class
ViewModel
- Mixed-in types
- Implementers
Constructors
- ViewModel.new({Object? key})
Properties
Methods
-
create(
) → void -
创建
inherited
-
destroy(
) → void -
销毁
override
-
finish(
[Object? data]) → void -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
sendNotify(
String message, {int? what, Object? data}) → void -
setInvokingFun(
{dynamic stateCall(VoidCallback )?, dynamic notifyCall(String message, {Object? data, int? what})?}) → void -
setScopeState(
VoidCallback fn, {bool notify = true}) → void - 通知所持有ViewModel的State组件更新。 notify 参数表示可关闭通知更新,只执行fn。
-
setState<
T> (LiveData liveData, LiveDataCallBack< T> fn, {bool notify = true}) → void - 通知订阅LiveData的组件更新。 notify 参数表示可关闭通知更新,只执行fn。
-
toString(
) → String -
A string representation of this object.
inherited
-
useLiveState<
T> (T value, [bool notify = false]) → LiveData< T> - 创建 ViewModelState notify 创建时是否更新状态
-
useState<
T> (T value, [bool notify = false]) → LiveData< T> - 创建 ViewModelState notify 创建时是否更新状态
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited