openConnectionIfNeeded method

void openConnectionIfNeeded()
inherited

Implementation

void openConnectionIfNeeded() {
  if (!shouldCreateInputConnection) {
    return;
  }

  if (!hasConnection) {
    _lastKnownRemoteTextEditingValue = textEditingValue;
    _textInputConnection = TextInput.attach(
      this,
      TextInputConfiguration(
        inputType: TextInputType.multiline,
        readOnly: widget.readOnly,
        obscureText: false,
        autocorrect: widget.enableSuggestions,
        inputAction: TextInputAction.newline,
        keyboardAppearance: widget.keyboardAppearance,
        textCapitalization: widget.textCapitalization,
      ),
    );

    _updateSizeAndTransform();
    _textInputConnection!.setEditingState(_lastKnownRemoteTextEditingValue!);

    _sentRemoteValues.add(_lastKnownRemoteTextEditingValue);
  }
  _textInputConnection!.show();
}