Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // user defined function
- void _showDialog() {
- // flutter defined function
- showDialog(
- context: context,
- builder: (BuildContext context) {
- // return object of type Dialog
- return AlertDialog(
- title: new Text("Alert Dialog title"),
- content: new Text("Alert Dialog body"),
- actions: <Widget>[
- // usually buttons at the bottom of the dialog
- new FlatButton(
- child: new Text("Close"),
- onPressed: () {
- Navigator.of(context).pop();
- },
- ),
- ],
- );
- },
- );
- }
Add Comment
Please, Sign In to add comment