handleInput method

  1. @override
ResponseInput handleInput(
  1. InputEvent event
)
override

Forwards the input event to the focused component's input handler, if any.

Returns a ResponseInput indicating whether the event was handled. If no component is focused, or the focused component ignores the event, returns ResponseInput.ignored.

Implementation

@override
ResponseInput handleInput(InputEvent event) {
  final focused = _focusManager.context.currentComponent;

  if (focused == null) {
    return ResponseInput.ignored();
  }

  InteractableComponentInstance handler = focused;

  final result = handler.handleInput(event);
  if (result.handled) return result;

  return ResponseInput.ignored();
}