showMessage method
Show a message with an OK button.
Implementation
Future<void> showMessage({
required final String message,
final String title = 'Error',
final String buttonLabel = 'OK',
}) =>
showDialog(
context: this,
builder: (final context) => AlertDialog(
actions: [
TextButton(
onPressed: () => Navigator.pop(context),
child: Text(buttonLabel),
),
],
title: Text(title),
content: CallbackShortcuts(
bindings: {
const SingleActivator(LogicalKeyboardKey.enter): () =>
Navigator.pop(context),
},
child: Focus(
autofocus: true,
child: Text(message),
),
),
semanticLabel: message,
),
);