exitOn static method
KeyBindings
exitOn({
- required Set<
KeyEventType> keys, - void onExit()?,
- String? hintLabel,
- String? hintDescription,
Creates bindings that exit on any of the specified keys.
Useful for "press Enter to continue" or "press any key" scenarios.
Implementation
static KeyBindings exitOn({
required Set<KeyEventType> keys,
void Function()? onExit,
String? hintLabel,
String? hintDescription,
}) {
return KeyBindings([
KeyBinding.multi(
keys,
(event) {
onExit?.call();
return KeyActionResult.confirmed;
},
hintLabel: hintLabel,
hintDescription: hintDescription,
),
]);
}