Package io.flutter.plugin.editing

# Class TextInputPlugin

java.lang.Object
io.flutter.plugin.editing.TextInputPlugin

public class TextInputPlugin extends Object
Android implementation of the text input plugin.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `TextInputPlugin(View view, TextInputChannel textInputChannel, ScribeChannel scribeChannel, PlatformViewsController platformViewsController, PlatformViewsController2 platformViewsController2)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `autofill(SparseArray<AutofillValue> values)`
  `void`
  `clearPlatformViewClient(int platformViewId)`
  Clears a platform view text input client if it is the current input target.
  `InputConnection`
  `createInputConnection(View view, KeyboardManager keyboardManager, EditorInfo outAttrs)`
  `void`
  `destroy()`
  Detaches the text input plugin from the platform views controller.
  `void`
  `didChangeEditingState(boolean textChanged, boolean selectionChanged, boolean composingRegionChanged)`
  `InputMethodManager`
  `getInputMethodManager()`
  `InputConnection`
  `getLastInputConnection()`
  `boolean`
  `handleKeyEvent(KeyEvent keyEvent)`
  `void`
  `lockPlatformViewInputConnection()`
  Use the current platform view input connection until unlockPlatformViewInputConnection is called.
  `void`
  `onProvideAutofillVirtualStructure(ViewStructure structure, int flags)`
  `void`
  `sendTextInputAppPrivateCommand(String action, Bundle data)`
  `void`
  `unlockPlatformViewInputConnection()`
  Unlocks the input connection.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### TextInputPlugin

    public TextInputPlugin(@NonNull View view, @NonNull TextInputChannel textInputChannel, @NonNull ScribeChannel scribeChannel, @NonNull PlatformViewsController platformViewsController, @NonNull PlatformViewsController2 platformViewsController2)

- ## Method Details

  - ### getInputMethodManager

    @NonNull public InputMethodManager getInputMethodManager()

  - ### lockPlatformViewInputConnection

    public void lockPlatformViewInputConnection()
    Use the current platform view input connection until unlockPlatformViewInputConnection is called.

    The current input connection instance is cached and any following call to @{link createInputConnection} returns the cached connection until unlockPlatformViewInputConnection is called.

    This is a no-op if the current input target isn't a platform view.

    This is used to preserve an input connection when moving a platform view from one virtual display to another.

  - ### unlockPlatformViewInputConnection

    public void unlockPlatformViewInputConnection()
    Unlocks the input connection.

    See also: @{link lockPlatformViewInputConnection}.

  - ### destroy

    public void destroy()
    Detaches the text input plugin from the platform views controller.

    The TextInputPlugin instance should not be used after calling this.

  - ### createInputConnection

    @Nullable public InputConnection createInputConnection(@NonNull View view, @NonNull KeyboardManager keyboardManager, @NonNull EditorInfo outAttrs)

  - ### getLastInputConnection

    @Nullable public InputConnection getLastInputConnection()

  - ### clearPlatformViewClient

    public void clearPlatformViewClient(int platformViewId)
    Clears a platform view text input client if it is the current input target.

    This is called when a platform view is disposed to make sure we're not hanging to a stale input connection.

  - ### sendTextInputAppPrivateCommand

    public void sendTextInputAppPrivateCommand(@NonNull String action, @NonNull Bundle data)

  - ### handleKeyEvent

    public boolean handleKeyEvent(@NonNull KeyEvent keyEvent)

  - ### didChangeEditingState

    public void didChangeEditingState(boolean textChanged, boolean selectionChanged, boolean composingRegionChanged)

  - ### onProvideAutofillVirtualStructure

    public void onProvideAutofillVirtualStructure(@NonNull ViewStructure structure, int flags)

  - ### autofill

    public void autofill(@NonNull SparseArray<AutofillValue> values)