dispose static method

void dispose()

Removes all registered callbacks from Keybinder and removes Keybinder's listener from the HardwareKeyboard instance.

Note: A new listener will be added to the HardwareKeyboard instance if another Keybinding is registered.

Implementation

static void dispose() {
  _keybindings.clear();
  _hardwareKeyboard?.removeHandler(_listener);
  _hardwareKeyboard = null;
}