toDialog<T> method

Future<T?> toDialog<T>(
  1. Widget dialog, {
  2. bool barrierDismissible = true,
  3. Color? barrierColor,
  4. bool useSafeArea = true,
  5. bool postponeToNextFrame = false,
})

Displays a Material dialog above the current contents of the app, with Material entrance and exit animations, modal barrier color, and modal barrier behavior (dialog is dismissible with a tap on the barrier).

  • Required parameters:
  • dialog: (positional parameter) Widget to display.
  • optional parameters:
  • barrierDismissible: Whether dialog is dismissible when tapping outside it. Default value is true.
  • barrierColor: the color of the modal barrier that darkens everything the dialog. If null the default color Colors.black54 is used.
  • useSafeArea: Whether the dialog should only display in 'safe' areas of the screen. Default value is true.

Equivalent to: showDialog.

Implementation

Future<T?> toDialog<T>(
  Widget dialog, {
  bool barrierDismissible = true,
  Color? barrierColor,
  bool useSafeArea = true,
  bool postponeToNextFrame = false,
}) {
  return _navigationBuilder.toDialog<T>(
    dialog,
    barrierColor: barrierColor,
    barrierDismissible: barrierDismissible,
    useSafeArea: useSafeArea,
    postponeToNextFrame: postponeToNextFrame,
  );
}