Created
February 3, 2020 12:00
-
-
Save ryanlid/5baa7f806a600da7009aabcc7d7a8855 to your computer and use it in GitHub Desktop.
SimpleDialog 简单对话框
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: 'SimpleDialog', | |
home: Scaffold( | |
appBar: AppBar( | |
title: Text('SimpleDialog'), | |
), | |
body: Center( | |
child: SimpleDialog( | |
title: const Text('对话框标题'), | |
children: <Widget>[ | |
SimpleDialogOption( | |
onPressed: () {}, | |
child: Text('第一行消息'), | |
), | |
SimpleDialogOption( | |
onPressed: () {}, | |
child: Text('第二行消息'), | |
), | |
], | |
), | |
), | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment