infoDialog static method

Future<void> infoDialog({
  1. required BuildContext context,
  2. required String title,
  3. required String message,
  4. bool barrierDismissible = true,
  5. String buttonText = "Ok",
  6. bool popByDefault = true,
  7. Function? onPressed,
})

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,
          );
        });