showWarningDialog<T> function
Future<T?>
showWarningDialog<T>(
- BuildContext context, {
- Key? key,
- Widget icon = const Icon(Icons.warning),
- Widget? title,
- Widget? content,
- DialogAction<
T> ? action, - bool barrierDismissible = false,
- Color? barrierColor,
- bool useSafeArea = true,
- RouteSettings? routeSettings,
Displays a dialog to warn the user about something that needs attention.
The default color of the dialog is [Colors.orange 300
] with the Icons.warning
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 showWarningDialog(context,
title: Text('User with pending issues'));
Implementation
Future<T?> showWarningDialog<T>(BuildContext context,
{Key? key,
Widget icon = const Icon(Icons.warning),
Widget? title,
Widget? content,
DialogAction<T>? action,
bool barrierDismissible = false,
Color? barrierColor,
bool useSafeArea = true,
bool useRootNavigator = true,
RouteSettings? routeSettings}) {
return showResultDialog(context,
key: key,
backgroundColor: Colors.orange[300]!,
textColor: Colors.white,
icon: icon,
title: (title ??
Text(StandardDialogsLocalizations.of(
context)[ResultDialogLocalizationsEnum.warning])),
content: content,
action: action,
barrierDismissible: barrierDismissible,
barrierColor: barrierColor,
useSafeArea: useSafeArea,
useRootNavigator: useRootNavigator,
routeSettings: routeSettings);
}