Created
February 4, 2020 09:24
-
-
Save ryanlid/1c4213209192ed883ca0689a583c15c8 to your computer and use it in GitHub Desktop.
CupertinoAlertDialog 组件示例
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/cupertino.dart'; | |
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
title: "CupertinoAlertDialog 组件示例", | |
home: Scaffold( | |
appBar: AppBar( | |
title: Text("CupertinoAlertDialog 组件示例"), | |
), | |
body: Center( | |
child: CupertinoAlertDialog( | |
// 对话框标题 | |
title: Text("提示"), | |
// 对话框内容部分 | |
content: SingleChildScrollView( | |
child: ListBody( | |
children: <Widget>[ | |
Text('是否要删除?'), | |
Text('一旦删除数据不可恢复!'), | |
], | |
), | |
), | |
// 对话框动作按钮 | |
actions: <Widget>[ | |
CupertinoDialogAction( | |
child: Text('确定'), | |
onPressed: () {}, | |
), | |
CupertinoDialogAction( | |
child: Text('取消'), | |
onPressed: () {}, | |
) | |
], | |
), | |
), | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment