onKeyEvent property

bool Function(KeyEvent event)? onKeyEvent
getter/setter pair

Optional callback to intercept key events before they are routed to the focused layer. If this returns true, the event is consumed and not propagated.

Implementation

bool Function(KeyEvent event)? onKeyEvent;