Interface TextInputChannel.TextInputMethodHandler

Enclosing class:
TextInputChannel

public static interface TextInputChannel.TextInputMethodHandler
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Clears the active text input client and tears down the text editing connection.
    void
    finishAutofillContext(boolean shouldSave)
    Requests that the AutofillManager cancel or commit the current autofill context.
    void
    Requests that the software keyboard (IME) be hidden from screen, dismissing the current text input view.
    void
    Requests that the autofill dropdown menu appear for the current client.
    void
    Sends client app private command to the current text input client(input method).
    void
    setClient(int textInputClientId, TextInputChannel.Configuration configuration)
    Sets the active text input client identifier along with its input text configurations (e.g., text capitalization rules, obscure text flags, and input actions such as done, go, or next).
    void
    setEditableSizeAndTransform(double width, double height, double[] transform)
    Sets the size and the transform matrix of the current text input client.
    void
    Sets the current text selection, composing ranges, and raw string contents for the active text input client.
    void
    setPlatformViewClient(int id, boolean usesVirtualDisplay)
    Sets a platform view as the text input client.
    void
    Requests that the software keyboard (IME) be displayed on screen for the active text input client.
  • Method Details

    • show

      void show()
      Requests that the software keyboard (IME) be displayed on screen for the active text input client.
    • hide

      void hide()
      Requests that the software keyboard (IME) be hidden from screen, dismissing the current text input view.
    • requestAutofill

      void requestAutofill()
      Requests that the autofill dropdown menu appear for the current client.

      Has no effect if the current client does not support autofill.

    • finishAutofillContext

      void finishAutofillContext(boolean shouldSave)
      Requests that the AutofillManager cancel or commit the current autofill context.

      The method calls AutofillManager.commit() when shouldSave is true, and calls AutofillManager.cancel() otherwise.

      Parameters:
      shouldSave - whether the active autofill service should save the current user input for future use.
    • setClient

      void setClient(int textInputClientId, @NonNull TextInputChannel.Configuration configuration)
      Sets the active text input client identifier along with its input text configurations (e.g., text capitalization rules, obscure text flags, and input actions such as done, go, or next).
      Parameters:
      textInputClientId - The unique ID of the text input client sent by the Dart framework via TextInput.setClient.
      configuration - The TextInputChannel.Configuration text editing configuration containing layout and behavior options.
    • setPlatformViewClient

      void setPlatformViewClient(int id, boolean usesVirtualDisplay)
      Sets a platform view as the text input client.

      Subsequent calls to createInputConnection will be delegated to the platform view until a different client is set.

      Parameters:
      id - the ID of the platform view to be set as a text input client.
      usesVirtualDisplay - True if the platform view uses a virtual display, false if it uses hybrid composition.
    • setEditableSizeAndTransform

      void setEditableSizeAndTransform(double width, double height, @NonNull double[] transform)
      Sets the size and the transform matrix of the current text input client.
      Parameters:
      width - the width of text input client. Must be finite.
      height - the height of text input client. Must be finite.
      transform - a 4x4 matrix that maps the local paint coordinate system to coordinate system of the FlutterView that owns the current client.
    • setEditingState

      void setEditingState(@NonNull TextInputChannel.TextEditState editingState)
      Sets the current text selection, composing ranges, and raw string contents for the active text input client.
      Parameters:
      editingState - The text state model containing the text, selections, and composing offsets.
    • clearClient

      void clearClient()
      Clears the active text input client and tears down the text editing connection.
    • sendAppPrivateCommand

      void sendAppPrivateCommand(@NonNull String action, @NonNull Bundle data)
      Sends client app private command to the current text input client(input method). The app private command result will be informed through performPrivateCommand.
      Parameters:
      action - Name of the command to be performed. This must be a scoped name. i.e. prefixed with a package name you own, so that different developers will not create conflicting commands.
      data - Any data to include with the command.