show static method
Future<int?>
show({
- required BuildContext context,
- required String title,
- String? message,
- required List<
CNAlertAction> actions, - int? preferredActionIndex,
- BaseParam? cupertino,
- BaseParam? material,
Shows a native alert dialog.
Implementation
static Future<int?> show({
required BuildContext context,
required String title,
String? message,
required List<CNAlertAction> actions,
int? preferredActionIndex,
BaseParam? cupertino,
BaseParam? material,
}) async {
// Convert CNAlertAction to BaseAlertAction
final baseActions = actions.map((action) => BaseAlertAction(
title: action.title,
style: _convertStyle(action.style),
onPressed: action.onPressed,
)).toList();
return await BaseAlert.show(
context: context,
title: title,
message: message,
actions: baseActions,
preferredActionIndex: preferredActionIndex,
cupertino: cupertino,
material: material,
);
}