Guest User

Untitled

a guest
Jun 25th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. // user defined function
  2. void _showDialog() {
  3. // flutter defined function
  4. showDialog(
  5. context: context,
  6. builder: (BuildContext context) {
  7. // return object of type Dialog
  8. return AlertDialog(
  9. title: new Text("Alert Dialog title"),
  10. content: new Text("Alert Dialog body"),
  11. actions: <Widget>[
  12. // usually buttons at the bottom of the dialog
  13. new FlatButton(
  14. child: new Text("Close"),
  15. onPressed: () {
  16. Navigator.of(context).pop();
  17. },
  18. ),
  19. ],
  20. );
  21. },
  22. );
  23. }
Add Comment
Please, Sign In to add comment