showQudsConfirmExitDialog function
Future<void>
showQudsConfirmExitDialog(
- BuildContext context, {
- Widget? child = const Text('Are you sure to exit?'),
- Widget builder(
- BuildContext context
- EdgeInsets insetPadding = _defaultDialogInsetPadding,
- String? title = 'Exit',
- AlignmentGeometry alignment = Alignment.center,
- Color? backgroundColor,
- BorderRadius? borderRadius,
- String exitText = 'Exit',
- String cancelText = 'Cancel',
- Color? barrierColor,
- bool withBlur = false,
- Function? onExitPressed,
- Function? onCancelPressed,
- bool withAnimatedSize = true,
Show confirmation exit dialog with two actions Exit
- Cancel
.
Implementation
Future<void> showQudsConfirmExitDialog(BuildContext context,
{Widget? child = const Text('Are you sure to exit?'),
Widget Function(BuildContext context)? builder,
EdgeInsets insetPadding = _defaultDialogInsetPadding,
String? title = 'Exit',
AlignmentGeometry alignment = Alignment.center,
Color? backgroundColor,
BorderRadius? borderRadius,
String exitText = 'Exit',
String cancelText = 'Cancel',
Color? barrierColor,
bool withBlur = false,
Function? onExitPressed,
Function? onCancelPressed,
bool withAnimatedSize = true}) async {
await showQudsYesNoDialog(context,
child: child,
builder: builder,
withBlur: withBlur,
barrierColor: barrierColor,
insetPadding: insetPadding,
title: title == null ? null : Text(title),
leadingActions: [
const QudsAutoAnimatedCombinedIcons(
startIcon: Icons.info_outline,
endIcon: Icons.exit_to_app_rounded,
endIconColor: Colors.red,
)
],
alignment: alignment,
backgroundColor: backgroundColor,
onYesPressed: onExitPressed,
onNoPressed: onCancelPressed,
yesColor: Colors.red,
yesText: exitText,
noText: cancelText,
withAnimatedSize: withAnimatedSize);
}