返回一个仓库提供器,它是一个Widget,需要store和child属性。...当然可以通过构造传参,但这显然十分麻烦,不仅乱,而且还要接收个参数。
?...,
child: Column(
children: Widget>[inputBtn, op, Expanded(child: listView)],
),...model.store.state.showBox,) ;
},
);
---->[定义CheckBox模型]----
class CheckBoxViewModel {
final Store...store;
final int index;
void Function(bool check) onClick;
CheckBoxViewModel(this.store,this.index