confirm static method

KeyBindings confirm({
  1. KeyActionResult onConfirm()?,
  2. String hintLabel = 'Enter',
  3. String hintDescription = 'confirm',
})

Creates confirm binding (Enter).

Implementation

static KeyBindings confirm({
  KeyActionResult Function()? onConfirm,
  String hintLabel = 'Enter',
  String hintDescription = 'confirm',
}) {
  return KeyBindings([
    KeyBinding.single(
      KeyEventType.enter,
      (event) => onConfirm?.call() ?? KeyActionResult.confirmed,
      hintLabel: hintLabel,
      hintDescription: hintDescription,
    ),
  ]);
}