Future<Null> showCupertinoDialog(BuildContext context,String title,String Content,
Widget sureWdiget,Widget cancelWidget){
List<Widget> returnWdigets = [];
if(sureWdiget != null) returnWdigets.add(sureWdiget);
if(cancelWidget != null) returnWdigets.add(cancelWidget);
return showDialog(context: context,builder: (context){
return CupertinoAlertDialog(
title: Text("$title"),
content: Text("$Content"),
actions: returnWdigets,
);
});
}
flutter如何几行代码封装一个简单易用的dialog
最新推荐文章于 2024-08-23 08:06:41 发布