synchronized_keyboard_listener 0.1.0 copy "synchronized_keyboard_listener: ^0.1.0" to clipboard
synchronized_keyboard_listener: ^0.1.0 copied to clipboard

A keyboard listener that can prevent keyboard events from being bubbled up

synchronized_keyboard_listener #

A keyboard listener with the ability to block keyboard events from bubbling up. This means if you have multiple SynchronizedKeyboardListener's only one will be able to act on any given keyboard event: the one lowest down in the tree that is listening for that particular key.

How it works is upon creation it looks for parent SynchronizedKeyboardListener's and forms a linked list of them. This allows them to synchronize their behaviour.

Usage #

The widget is self explanatory.

SynchronizedKeyboardListener(
  keyEvents: <LogicalKeyboardKey, Function()> {
    LogicalKeyboardKey.escape : () { Navigator.of(context).pop(); },
    LogicalKeyboardKey.enter : () { Navigator.of(context).pop(); },
  },
  child: ...
)

The key events argument tells us which keys to listen for and what to do if they are triggered.

5
likes
130
points
67
downloads

Publisher

unverified uploader

Weekly Downloads

A keyboard listener that can prevent keyboard events from being bubbled up

Repository (GitLab)
View/report issues

Documentation

API reference

License

unknown (license)

Dependencies

flutter

More

Packages that depend on synchronized_keyboard_listener