要使用
StatefulBuilder
eg:
showModalBottomSheet(
backgroundColor: Colors.transparent,
context: context,
builder: (context) {
return StatefulBuilder(builder: (context,state){
return Container(
decoration: BoxDecoration(
color: Colors.white, borderRadius: BorderRadius.circular(50.w)),
child: Column(
children: [
Container(
alignment: Alignment.center,
child: Text(
'修改环境',
style: TextStyle(fontSize: 40.sp, color: Colors.black),
),
height: 160.w,
),
_buildListViewItem('测试环境', weegetConf.Env.test,state),
Divider(),
_buildListViewItem('集成环境', weegetConf.Env.release,state),
Divider(),
_buildListViewItem('预发布环境', weegetConf.Env.releaseV2,state),
Divider(),
_buildListViewItem('生产环境', weegetConf.Env.product,state),
_submitBtn(),
],
),
);
});
});