setInputControl static method
- 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:
- TextInputControl, an interface for implementing text input controls.
- TextInput.restorePlatformInputControl, a method to restore the default platform text input control.
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);
}