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 innerContext) => AlertDialog(
actions: [
TextButton(onPressed: innerContext.pop, child: Text(buttonLabel)),
],
title: Text(title),
content: CallbackShortcuts(
bindings: {
const SingleActivator(LogicalKeyboardKey.enter): innerContext.pop,
},
child: Focus(autofocus: true, child: Text(message)),
),
semanticLabel: message,
),
);