showPumaAlert function
dynamic
showPumaAlert(})
Implementation
showPumaAlert(
BuildContext context, {
String title = "",
String message = "",
String yes = "OK",
String? no,
void Function()? onYes,
void Function()? onNo,
Color yesColor = Colors.red,
Color noColor = Colors.blue,
}) {
var alert;
if (Platform.isIOS) {
alert = CupertinoAlertDialog(
title: new Text(title),
content: new Text(message),
actions: [
if (no != null)
getCupertinoButton(no, noColor,
onNo == null ? () => Navigator.of(context).pop() : onNo),
getCupertinoButton(yes, yesColor, onYes!)
],
);
} else {
alert = AlertDialog(
title: Text(title),
content: Text(message),
actions: [
if (no != null)
getMaterialButton(no, noColor,
onNo == null ? () => Navigator.of(context).pop() : onNo),
getMaterialButton(yes, yesColor, onYes!),
],
);
}
showDialog(
context: context,
builder: (BuildContext context) {
return alert;
},
);
}