-
AlertDialog继承于StatelessWidget,可以作为组件使用
-
常见使用形式是showDialog+AlertDialog的组合形式
-
sh owDialog
和AlertDialog
配合使用展示Material风格对话框 -
showCupertinoDialog
和CupertinoAlertDialog
配合使用展示iOS风格对话框 -
showCupertinoDialog
点击空白处是无法退出对话框的,而showDialog
点击空白处默认退出对话框 -
barrierDismissible
属性控制点击空白处的行为
2.3 AlertDialog构造函数
const AlertDialog({
Key? key,
this.title,
this.titlePadding,
this.titleTextStyle,
this.content,
this.contentPadding = const EdgeInsets.fromLTRB(24.0, 20.0, 24.0, 24.0),
this.contentTextStyle,
this.actions,
this.actionsPadding = EdgeInsets.zero,