alert static method
Shows an informational alert and completes when it is closed.
Implementation
static Future<void> alert(
BuildContext context, {
required String title,
required String message,
String actionLabel = 'OK',
Widget? icon,
bool barrierDismissible = true,
XLook look = XLook.standard,
}) {
final lookPreset = XDialogLook.resolve(look);
return show<void>(
context,
barrierDismissible: barrierDismissible,
builder: (dialogContext) => AlertDialog(
icon: icon,
title: Text(title),
content: Text(message),
backgroundColor: lookPreset.backgroundColor,
elevation: lookPreset.elevation,
shape: look == XLook.standard ? null : lookPreset.shape,
actions: [
TextButton(
onPressed: () => Navigator.of(dialogContext).pop(),
child: Text(actionLabel),
),
],
),
);
}