infoDialog static method
This method will display an informative dialog with just one button
Implementation
static Future<void> infoDialog({
required BuildContext context,
required String title,
required String message,
bool barrierDismissible = true,
/// Button text, default : Ok
String buttonText = "Ok",
bool popByDefault = true,
Function? onPressed,
}) async =>
await showDialog(
barrierDismissible: barrierDismissible,
context: context,
builder: (context) {
if (Theme.of(context).platform == TargetPlatform.iOS) {
return CupertinoInfoDialog(
title: title,
message: message,
buttonText: buttonText,
onPressed: onPressed,
popByDefault: popByDefault,
);
}
return MaterialInfoDialog(
title: title,
message: message,
buttonText: buttonText,
onPressed: onPressed,
popByDefault: popByDefault,
);
});