showSuccessDialog<T> function
Future<T?>
showSuccessDialog<T>(
- BuildContext context, {
- Key? key,
- Widget icon = const Icon(Icons.check_circle),
- Widget? title,
- Widget? content,
- DialogAction<
T> ? action, - bool barrierDismissible = false,
- Color? barrierColor,
- bool useSafeArea = true,
- RouteSettings? routeSettings,
Displays a dialog to indicate the result of an action that has been successfully performed
The default color of the dialog is [Colors.lightGreen 400
] with the
Icons.check_circle 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 showSuccessDialog(context,
title: Text('User created'),
content: Text('User created successfully!'),
action: DialogAction(
title: Text('Get Started'),
action: null)
);
Implementation
Future<T?> showSuccessDialog<T>(BuildContext context,
{Key? key,
Widget icon = const Icon(Icons.check_circle),
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.lightGreen[400]!,
textColor: Colors.white,
icon: icon,
title: (title ??
Text(StandardDialogsLocalizations.of(
context)[ResultDialogLocalizationsEnum.success])),
content: content,
action: action,
barrierDismissible: barrierDismissible,
barrierColor: barrierColor,
useSafeArea: useSafeArea,
useRootNavigator: useRootNavigator,
routeSettings: routeSettings);
}