showError static method

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

Implementation

static Future showError({
  required BuildContext context,
  String? title,
  required String message,
  VoidCallback? onCancel,
}) async {
  return showDialog(
      barrierDismissible: false,
      context: context,
      builder: (BuildContext context) {
        return AtOnboardingDialog(
          title: title ?? 'Error',
          message: message,
          actions: [
            AtOnboardingSecondaryButton(
              child: const Text('Close'),
              onPressed: () {
                Navigator.pop(context);
                onCancel?.call();
              },
            ),
          ],
        );
      });
}