Components · App
Confirm dialog
Unified confirmation dialog, with a destructive variant.
App · Flutter · macromath_mobile
A confirmation dialog that stays consistent across the app: two text buttons —
"Cancel" in grey and the main action colored only in text (orange, or red when
destructive). Imported from macromath_mobile.
Preview
Delete food
Are you sure? This action cannot be undone.
Cancel Delete
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
title | String | — | Dialog title. |
message | String? | null | Supporting text. |
confirmLabel | String | 'Confirm' | Main action label. |
cancelLabel | String | 'Cancel' | Cancel label. |
destructive | bool | false | Paints the action red. |
Usage
import 'package:macromath_mobile/presentation/widgets/app_confirm_dialog.dart';
final ok = await AppConfirmDialog.show(
context,
title: 'Delete food',
message: 'Are you sure? This action cannot be undone.',
confirmLabel: 'Delete',
destructive: true,
);
if (ok) { /* ... */ }Open it live in the Widgetbook → Feedback › Confirm dialog.