attach method

TextInputConnection attach (TextInputClient client, TextInputConfiguration configuration)

Begin interacting with the text input control.

Calling this function helps multiple clients coordinate about which one is currently interacting with the text input control. The returned TextInputConnection provides an interface for actually interacting with the text input control.

A client that no longer wishes to interact with the text input control should call TextInputConnection.close on the returned TextInputConnection.

Implementation

static TextInputConnection attach(TextInputClient client, TextInputConfiguration configuration) {
  assert(client != null);
  assert(configuration != null);
  assert(_debugEnsureInputActionWorksOnPlatform(configuration.inputAction));
  final TextInputConnection connection = TextInputConnection._(client);
  _clientHandler._currentConnection = connection;
  SystemChannels.textInput.invokeMethod<void>(
    'TextInput.setClient',
    <dynamic>[ connection._id, configuration.toJson() ],
  );
  return connection;
}