Class TextInputChannel
- java.lang.Object
-
- io.flutter.embedding.engine.systemchannels.TextInputChannel
-
public class TextInputChannel extends Object
TextInputChannelis a platform channel between Android and Flutter that is used to communicate information about the user's text input.When the user presses an action button like "done" or "next", that action is sent from Android to Flutter through this
TextInputChannel.When an input system in the Flutter app wants to show the keyboard, or hide it, or configure editing state, etc. a message is sent from Flutter to Android through this
TextInputChannel.TextInputChannelcomes with a defaultMethodChannel.MethodCallHandlerthat parses incoming messages from Flutter. Register aTextInputChannel.TextInputMethodHandlerto respond to standard Flutter text input messages.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTextInputChannel.ConfigurationA text editing configuration.static classTextInputChannel.InputTypeA text input type.static classTextInputChannel.TextCapitalizationText capitalization schemes.static classTextInputChannel.TextEditStateState of an on-going text editing session.static interfaceTextInputChannel.TextInputMethodHandlerstatic classTextInputChannel.TextInputTypeTypes of text input.
-
Field Summary
Fields Modifier and Type Field Description MethodChannelchannel
-
Constructor Summary
Constructors Constructor Description TextInputChannel(DartExecutor dartExecutor)Constructs aTextInputChannelthat connects Android to the Dart code running indartExecutor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddone(int inputClientId)Instructs Flutter to execute a "done" action.voidgo(int inputClientId)Instructs Flutter to execute a "go" action.voidnewline(int inputClientId)Instructs Flutter to execute a "newline" action.voidnext(int inputClientId)Instructs Flutter to execute a "next" action.voidperformPrivateCommand(int inputClientId, String action, Bundle data)voidprevious(int inputClientId)Instructs Flutter to execute a "previous" action.voidrequestExistingInputState()Instructs Flutter to reattach the last active text input client, if any.voidsearch(int inputClientId)Instructs Flutter to execute a "search" action.voidsend(int inputClientId)Instructs Flutter to execute a "send" action.voidsetTextInputMethodHandler(TextInputChannel.TextInputMethodHandler textInputMethodHandler)Sets theTextInputChannel.TextInputMethodHandlerwhich receives all events and requests that are parsed from the underlying platform channel.voidunspecifiedAction(int inputClientId)Instructs Flutter to execute an "unspecified" action.voidupdateEditingState(int inputClientId, String text, int selectionStart, int selectionEnd, int composingStart, int composingEnd)Instructs Flutter to update its text input editing state to reflect the given configuration.voidupdateEditingStateWithDeltas(int inputClientId, ArrayList<TextEditingDelta> batchDeltas)voidupdateEditingStateWithTag(int inputClientId, HashMap<String,TextInputChannel.TextEditState> editStates)
-
-
-
Field Detail
-
channel
@NonNull public final MethodChannel channel
-
-
Constructor Detail
-
TextInputChannel
public TextInputChannel(@NonNull DartExecutor dartExecutor)Constructs aTextInputChannelthat connects Android to the Dart code running indartExecutor.The given
dartExecutoris permitted to be idle or executing code.See
DartExecutor.
-
-
Method Detail
-
requestExistingInputState
public void requestExistingInputState()
Instructs Flutter to reattach the last active text input client, if any.This is necessary when the view hierarchy has been detached and reattached to a
FlutterEngine, as the engine may have kept alive a text editing client on the Dart side.
-
updateEditingState
public void updateEditingState(int inputClientId, @NonNull String text, int selectionStart, int selectionEnd, int composingStart, int composingEnd)Instructs Flutter to update its text input editing state to reflect the given configuration.
-
updateEditingStateWithDeltas
public void updateEditingStateWithDeltas(int inputClientId, @NonNull ArrayList<TextEditingDelta> batchDeltas)
-
updateEditingStateWithTag
public void updateEditingStateWithTag(int inputClientId, @NonNull HashMap<String,TextInputChannel.TextEditState> editStates)
-
newline
public void newline(int inputClientId)
Instructs Flutter to execute a "newline" action.
-
go
public void go(int inputClientId)
Instructs Flutter to execute a "go" action.
-
search
public void search(int inputClientId)
Instructs Flutter to execute a "search" action.
-
send
public void send(int inputClientId)
Instructs Flutter to execute a "send" action.
-
done
public void done(int inputClientId)
Instructs Flutter to execute a "done" action.
-
next
public void next(int inputClientId)
Instructs Flutter to execute a "next" action.
-
previous
public void previous(int inputClientId)
Instructs Flutter to execute a "previous" action.
-
unspecifiedAction
public void unspecifiedAction(int inputClientId)
Instructs Flutter to execute an "unspecified" action.
-
performPrivateCommand
public void performPrivateCommand(int inputClientId, @NonNull String action, @NonNull Bundle data)
-
setTextInputMethodHandler
public void setTextInputMethodHandler(@Nullable TextInputChannel.TextInputMethodHandler textInputMethodHandler)Sets theTextInputChannel.TextInputMethodHandlerwhich receives all events and requests that are parsed from the underlying platform channel.
-
-