error static method
- dynamic e
Shows an error popup with the provided argument.
Implementation
static Future<void> error(dynamic e) async {
var message = e is LocalizedExceptionMixin ? e.toMessage() : e.toString();
await showDialog(
context: router.context!,
builder:
(context) => AlertDialog(
title: Text('label_error'.l10n),
content: Text(message),
actions: [
TextButton(
onPressed: () => Navigator.of(router.context!).pop(),
child: Text('btn_ok'.l10n),
),
],
),
);
}