showMessage method
Show a message with an OK button.
Implementation
Future<void> showMessage({
required String message,
String title = 'Error',
String buttonLabel = 'OK',
}) => showDialog(
context: this,
builder: (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,
),
);