showQudsConfirmExitDialog function

Future<void> showQudsConfirmExitDialog(
  1. BuildContext context, {
  2. Widget? child = const Text('Are you sure to exit?'),
  3. Widget builder(
    1. BuildContext context
    )?,
  4. EdgeInsets insetPadding = _defaultDialogInsetPadding,
  5. String? title = 'Exit',
  6. AlignmentGeometry alignment = Alignment.center,
  7. Color? backgroundColor,
  8. BorderRadius? borderRadius,
  9. String exitText = 'Exit',
  10. String cancelText = 'Cancel',
  11. Color? barrierColor,
  12. bool withBlur = false,
  13. Function? onExitPressed,
  14. Function? onCancelPressed,
  15. 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);
}