letter static method
Creates letter key binding for a specific character (case-insensitive).
Implementation
static KeyBindings letter({
required String char,
required void Function() onPress,
String? hintLabel,
String? hintDescription,
}) {
final lower = char.toLowerCase();
final upper = char.toUpperCase();
return KeyBindings([
KeyBinding.char(
(c) => c == lower || c == upper,
(event) {
onPress();
return KeyActionResult.handled;
},
hintLabel: hintLabel ?? upper,
hintDescription: hintDescription,
),
]);
}