alibaba / fish-redux

An assembled flutter application framework.
https://github.com/alibaba/fish-redux
Apache License 2.0
7.33k stars 843 forks source link

底部弹出框_openModalBottomSheet上使用CheckboxListTile怎么能让checkbox状态实时刷新,谢谢 #719

Open xiami006 opened 4 years ago

xiami006 commented 4 years ago

view中无法setState方法,使用fish redux框架的state数据是更新了,但是checkbox的状态没有实时刷新,需要重新打开底部弹出框才能刷新 Future _openModalBottomSheet(ParentCtrNetTimeState state, Dispatch dispatch, BuildContext context) async { int groupValue = 0; bool check=false; final option = await showModalBottomSheet( context: context, builder: (BuildContext context) { return Container( height: 400.0, child: Column( children: [ CheckboxListTile( title: Text( S.of(context).extuesday, style: TextStyle( color: Colors.black38, fontSize: setSp(Dimens.font_sp14), ), ), value: check, onChanged: (bool value) { check=value; //dispatch(ParentCtrNetTimeActionCreator.onUpdateMondayAction(value)); }, ), ], ), ); } );}

JasonHezz commented 4 years ago

使用 StatefulBuilder