Displays a dialog above the current contents of the app.
This function typically receives a Dialog widget as its child argument. Content below the dialog is dimmed with a ModalBarrier.
Returns a Future
that resolves to the value (if any) that was passed to
Navigator.pop when the dialog was closed.
See also:
- SimpleDialog, which handles the scrolling of the contents but has no
actions
. - AlertDialog, for dialogs that have a row of buttons below the body.
- Dialog, on which SimpleDialog and AlertDialog are based.
- material.google.com/components/dialogs.html
Source
Future<dynamic/*=T*/> showDialog/*<T>*/({ BuildContext context, Widget child }) { return Navigator.push(context, new _DialogRoute<dynamic/*=T*/>( child: child, theme: Theme.of(context, shadowThemeOnly: true), )); }