showQudsConfirmDeleteDialog function

Future<void> showQudsConfirmDeleteDialog(
  1. BuildContext context, {
  2. Widget? child = const Text('Are you sure to delete?'),
  3. Widget builder(
    1. BuildContext context
    )?,
  4. EdgeInsets insetPadding = _defaultDialogInsetPadding,
  5. String? title = 'Delete',
  6. AlignmentGeometry alignment = Alignment.center,
  7. Color? backgroundColor,
  8. Color? barrierColor,
  9. BorderRadius? borderRadius,
  10. String deleteText = 'Delete',
  11. String cancelText = 'Cancel',
  12. bool withBlur = false,
  13. Function? onDeletePressed,
  14. Function? onCancelPressed,
  15. bool withAnimatedSize = true,
})

Show confirmation delete dialog with two actions Delete - Cancel.

Implementation

Future<void> showQudsConfirmDeleteDialog(BuildContext context,
    {Widget? child = const Text('Are you sure to delete?'),
    Widget Function(BuildContext context)? builder,
    EdgeInsets insetPadding = _defaultDialogInsetPadding,
    String? title = 'Delete',
    AlignmentGeometry alignment = Alignment.center,
    Color? backgroundColor,
    Color? barrierColor,
    BorderRadius? borderRadius,
    String deleteText = 'Delete',
    String cancelText = 'Cancel',
    bool withBlur = false,
    Function? onDeletePressed,
    Function? onCancelPressed,
    bool withAnimatedSize = true}) async {
  await showQudsYesNoDialog(context,
      child: child,
      barrierColor: barrierColor,
      builder: builder,
      withBlur: withBlur,
      insetPadding: insetPadding,
      title: title == null ? null : Text(title),
      leadingActions: [
        const QudsAutoAnimatedCombinedIcons(
          startIcon: Icons.info_outline,
          endIcon: Icons.delete_outlined,
          endIconColor: Colors.red,
        )
      ],
      alignment: alignment,
      backgroundColor: backgroundColor,
      onYesPressed: onDeletePressed,
      onNoPressed: onCancelPressed,
      yesColor: Colors.red,
      yesText: deleteText,
      noText: cancelText,
      withAnimatedSize: withAnimatedSize);
}