需要写在事件中
onTap: () { showCupertinoModalPopup( context: context, builder: (context) { return CupertinoActionSheet( // title: Text(‘‘, style: TextStyle(fontSize: AppConfig.screenUtil(val: 35, val2: 20)),), //标题 // message: Text(‘麻烦抽出几分钟对该软件进行评价,谢谢!‘), //提示内容 actions: <Widget>[ //操作按钮集合 CupertinoActionSheetAction( onPressed: () { NavigatorUtil.pushNamedWithParam( context, Routes.addressedit, val[‘id‘]) .then((v) { resetData(); }); }, child: Text(‘编辑‘, style: TextStyle(fontSize: AppConfig.screenUtil(val: 30, val2: 20)),), ), CupertinoActionSheetAction( onPressed: () { AppUtils.delDataById(val[‘id‘], "address", () { resetData(); }); }, child: Text(‘删除‘, style: TextStyle(fontSize: AppConfig.screenUtil(val: 30, val2: 20)),), ), ], cancelButton: CupertinoActionSheetAction( //取消按钮 onPressed: () { Navigator.pop(context); }, child: Text(‘取消‘, style: TextStyle(fontSize: AppConfig.screenUtil(val: 30, val2: 20)),), ), ); }, );