Skip to content

Instantly share code, notes, and snippets.

@ryanlid
Created February 3, 2020 12:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryanlid/5baa7f806a600da7009aabcc7d7a8855 to your computer and use it in GitHub Desktop.
Save ryanlid/5baa7f806a600da7009aabcc7d7a8855 to your computer and use it in GitHub Desktop.
SimpleDialog 简单对话框
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