showSKAlert function
Implementation
Future<bool?> showSKAlert(
Widget msg, {
Widget? title,
Widget? confirmText,
Widget? cancelText,
bool isCancelable = true,
BuildContext? context,
BuildContextPredicate buildContextPredicate = _defaultContextPredicate,
}) {
if (context == null) {
_throwIfNoContext(_contextMap.values, 'showAlert');
}
context ??= buildContextPredicate(_contextMap.values);
return showDialog<bool>(
context: context,
barrierDismissible: isCancelable,
builder: (context) => AlertDialog(
content: msg,
title: title,
actions: [
TextButton(
onPressed: () {
Navigator.pop(context, true);
},
child: confirmText ?? const Text("OK")),
TextButton(
onPressed: () {
Navigator.pop(context, false);
},
child: cancelText ?? const Text("Cancel"))
],
),
);
}