confirm static method
Implementation
static Future<bool> confirm(
BuildContext context, {
required String title,
required String message,
String cancelLabel = 'Cancel',
String confirmLabel = 'Confirm',
bool destructive = false,
}) async {
final result = await show<bool>(
context,
title: title,
content: Text(
message,
style: context.typography.bodySmall.copyWith(
color: context.kolors.textSecondary,
),
),
actions: [
KiteButton(
label: cancelLabel,
variant: KiteButtonVariant.ghost,
onPressed: () => Navigator.of(context).pop(false),
),
KiteButton(
label: confirmLabel,
variant: destructive
? KiteButtonVariant.danger
: KiteButtonVariant.filled,
onPressed: () => Navigator.of(context).pop(true),
),
],
);
return result ?? false;
}