show static method

Future<bool> show(
  1. BuildContext context, {
  2. required String title,
  3. required String message,
  4. String confirmLabel = 'Conferma',
  5. String cancelLabel = 'Annulla',
  6. bool isDestructive = false,
  7. IconData? icon,
})

Shows a CLConfirmationDialog and returns whether the user confirmed.

Resolves to false if the dialog is dismissed without an explicit confirmation (e.g. tapping outside or pressing back).

Implementation

static Future<bool> show(
  BuildContext context, {
  required String title,
  required String message,
  String confirmLabel = 'Conferma',
  String cancelLabel = 'Annulla',
  bool isDestructive = false,
  IconData? icon,
}) async {
  final result = await showDialog<bool>(
    context: context,
    builder: (_) => CLConfirmationDialog(
      title: title,
      message: message,
      confirmLabel: confirmLabel,
      cancelLabel: cancelLabel,
      isDestructive: isDestructive,
      icon: icon,
    ),
  );
  return result ?? false;
}