showErrorDialog<T> function

Future<T> showErrorDialog<T>(
  1. BuildContext context,
  2. {Widget icon = const Icon(Icons.error),
  3. Widget title,
  4. Widget content,
  5. DialogAction<T> action,
  6. bool barrierDismissible = false,
  7. Color barrierColor,
  8. bool useSafeArea = true,
  9. bool useRootNavigator = true,
  10. RouteSettings routeSettings}
)

Displays a dialog to indicate the result of an action that resulted in an error.

The default color of the dialog is [Colors.red 300] with the Icons.error icon, if you want to modify the displayed icon, enter the icon parameter.

If you want to display more details about the operation, use the content parameter.

Example of using the dialog:

await showErrorDialog(context,
    title: Text('Error creating user'));

Implementation

Future<T> showErrorDialog<T>(BuildContext context,
    {Widget icon = const Icon(Icons.error),
    Widget title,
    Widget content,
    DialogAction<T> action,
    bool barrierDismissible = false,
    Color barrierColor,
    bool useSafeArea = true,
    bool useRootNavigator = true,
    RouteSettings routeSettings}) {
  return showResultDialog(context,
      backgroundColor: Colors.red[300],
      textColor: Colors.white,
      icon: icon,
      title:
          title, // ?? Text(StandardDialogsLocalizations.of(context)[ResultDialogLocalizationsEnum.error])),
      content: content,
      action: action,
      barrierDismissible: barrierDismissible,
      barrierColor: barrierColor,
      useSafeArea: useSafeArea,
      useRootNavigator: useRootNavigator,
      routeSettings: routeSettings);
}