showQudsConfirmDeleteDialog function
Future<void>
showQudsConfirmDeleteDialog(
- BuildContext context, {
- Widget? child = const Text('Are you sure to delete?'),
- Widget builder(
- BuildContext context
- 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,
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);
}