onKeyboardEvent method

void onKeyboardEvent(
  1. dynamic arg
)

Internal function to handle native code channel communication

Implementation

void onKeyboardEvent(dynamic arg) {
  isKeyboardVisible = (arg as int) == 1;

  // send a message to all subscribers notifying them about the new state
  _list.forEach((subscriber, s) {
    try {
      s.onChange!(isKeyboardVisible);
      if (isKeyboardVisible) {
        s.onShow!();
      }
      if (!isKeyboardVisible) {
        s.onHide!();
      }
    } catch (_) {}
  });
}