showSubZeroAlertDialog function
An alert dialog helper for informational messages.
This is a convenience wrapper around showSubZeroDialog for simple alert/info scenarios with a single dismiss button.
Example usage:
await showSubZeroAlertDialog(
context: context,
title: 'Success',
body: 'Your profile has been updated.',
dismissLabel: 'OK',
);
Implementation
Future<void> showSubZeroAlertDialog({
required BuildContext context,
required String title,
String? body,
String dismissLabel = 'OK',
bool useFlushedButton = false,
IconData? trailingIcon,
}) {
return showSubZeroDialog(
context: context,
title: title,
body: body,
actionLayout: useFlushedButton
? SubZeroDialogActionLayout.flushed
: SubZeroDialogActionLayout.sideBySide,
actions: SubZeroDialogActions(
primaryLabel: dismissLabel,
onPrimary: () => Navigator.of(context).pop(),
primaryTrailingIcon: trailingIcon,
),
);
}