showAlertDialog method
Implementation
void showAlertDialog({
String? title,
String? message,
required BuildContext context,
}) {
/**
* if (title = null && message = null) title = error, message = stackTrace
* else if (message = null) message = stackTrace
* else if (title = null) title = error
* else;
*/
message ??= title == null ? stackTrace.toString() : error.toString();
title ??= error.toString();
showDialog(
context: context,
builder: (context) {
return AlertDialog(
title: Text(title!),
content: Text(message!),
actions: [
TextButton(
onPressed: () {
Navigator.pop(context);
},
child: const Text("Ok"),
),
],
);
},
);
}