showError static method

Future showError({
  1. required BuildContext context,
  2. String? title,
  3. required String message,
  4. VoidCallback? onCancel,
  5. ThemeData? themeData,
})

Implementation

static Future showError({
  required BuildContext context,
  String? title,
  required String message,
  VoidCallback? onCancel,
  ThemeData? themeData,
}) async {
  return showDialog(
    barrierDismissible: false,
    context: context,
    builder: (BuildContext context) {
      return Theme(
        data: themeData ?? Theme.of(context),
        child: AtOnboardingDialog(
          title: title ?? AtOnboardingLocalizations.current.notice,
          message: message,
          actions: [
            AtOnboardingSecondaryButton(
              child: Text(
                AtOnboardingLocalizations.current.btn_close,
              ),
              onPressed: () {
                Navigator.pop(context);
                onCancel?.call();
              },
            ),
          ],
        ),
      );
    },
  );
}