data_binding 0.2.3 data_binding: ^0.2.3 copied to clipboard
Library data_binding is an observable data holder class. It is lifecycle-aware, meaning it respects the lifecycle of widgets. This awareness ensures it only updates widget observers that are in an act [...]
data_binding #
This is a library of Flutter for data binding works as similar as what Android does.
类Android的Flutter数据绑定库。
How to use #
- Create sub class of
BaseViewModel
withObservable
s.
创建BaseViewModel
的子类,在其中添加多个Observable
。
- Create sub class of
BindingWidgetBuilder
, which builds Widget with the data from aObservable
.
创建BindingWidgetBuilder
的子类,其用某个Observable
的数据来生成Widget。
binding()
theObservable
and theBindingWidgetBuilder
.
用binding()
绑定Observable
和BindingWidgetBuilder
。
- When the
property
of theObservable
in the ViewModel was changed, the Widget would be updated.
当ViewModel中的Observable
的property
被改变时,Widget也会更新。