Created
February 3, 2020 12:58
-
-
Save ryanlid/76530b0c8bb71a9a4b3f4a237f84a8e4 to your computer and use it in GitHub Desktop.
AlertDialog 提示对话框
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/material.dart'; | |
void main(){ | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
title: 'AlertDialog', | |
home: Scaffold( | |
appBar: AppBar( | |
title: Text("AlertDialog"), | |
), | |
body: Center( | |
child: AlertDialog( | |
title: Text("提示"), | |
content: SingleChildScrollView( | |
child: ListBody( | |
children: <Widget>[ | |
Text("是否要删除"), | |
Text("一旦删除数据不可恢复") | |
], | |
), | |
), | |
// 对话框操作 | |
actions: <Widget>[ | |
FlatButton( | |
child: Text('确定'), | |
onPressed: (){}, | |
), | |
FlatButton( | |
child: Text('取消'), | |
onPressed: (){}, | |
), | |
], | |
), | |
), | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment