requestKeyboard method

  1. @override
void requestKeyboard()
override

Express interest in interacting with the keyboard.

If this control is already attached to the keyboard, this function will request that the keyboard become visible. Otherwise, this function will ask the focus system that it become focused. If successful in acquiring focus, the control will then attach to the keyboard and request that the keyboard become visible.

Implementation

@override
void requestKeyboard() {
  if (controller.skipRequestKeyboard) {
    // and that just by one simple change
    controller.skipRequestKeyboard = false;
    return;
  }
  if (_hasFocus) {
    final keyboardAlreadyShown = _keyboardVisible;
    openConnectionIfNeeded();
    if (!keyboardAlreadyShown) {
      /// delay 500 milliseconds for waiting keyboard show up
      Future.delayed(
        const Duration(milliseconds: 500),
        _showCaretOnScreen,
      );
    } else {
      _showCaretOnScreen();
    }
  } else {
    widget.configurations.focusNode.requestFocus();
  }
}