setInputControl static method

void setInputControl(
  1. TextInputControl? newControl
)

Sets the current text input control.

The current text input control receives text input state changes and visual text input control requests, such as showing and hiding the input control, from the framework.

Setting the current text input control as null removes the visual text input control.

See also:

Implementation

static void setInputControl(TextInputControl? newControl) {
  final TextInputControl? oldControl = _instance._currentControl;
  if (newControl == oldControl) {
    return;
  }
  if (newControl != null) {
    _addInputControl(newControl);
  }
  if (oldControl != null) {
    _removeInputControl(oldControl);
  }
  _instance._currentControl = newControl;
  final TextInputClient? client = _instance._currentConnection?._client;
  client?.didChangeInputControl(oldControl, newControl);
}