error method Null safety

Future<void> error(
  1. {required dynamic context,
  2. String? title}
)

Shows an loading error dialog.

Typical use-case: when the run call failed.

Implementation

static Future<void> error({
  required final BuildContext context,
  final String? title,
}) async =>
    showDialog<void>(
      context: context,
      builder: (BuildContext context) {
        final AppLocalizations appLocalizations =
            AppLocalizations.of(context);
        return SmoothAlertDialog(
          body: ListTile(
            leading: const Icon(Icons.error),
            title: Text(
              title ?? appLocalizations.loading_dialog_default_error_message,
            ),
          ),
          actions: <SmoothActionButton>[
            SmoothActionButton(
              text: appLocalizations.close,
              onPressed: () => Navigator.maybePop(context),
            ),
          ],
        );
      },
    );