FluentTextInputHandler class

Singleton IME handler that implements TextInputClient for Flutter's system text input channel. Preedit text is kept isolated from the document model and only committed when the composition genuinely ends.

Mixed-in types

Constructors

FluentTextInputHandler()
factory

Properties

composingRange TextRange
no setter
currentAutofillScope AutofillScope?
The AutofillScope this TextInputClient belongs to, if any.
no setteroverride
currentTextEditingValue TextEditingValue?
The current state of the TextEditingValue held by this client.
no setteroverride
cursorIsAtFragmentStart bool
True when the cursor is at the very start of the current fragment. On buffer-sync platforms (iOS virtual keyboard) the IME has no text before the cursor in its internal buffer, so a backspace will not emit a deletion delta and must be handled structurally by the editor.
no setter
hashCode int
The hash code for this object.
no setterinherited
isComposing bool
no setter
isConnectionActive bool
Whether the platform TextInput connection is currently open.
no setter
preeditFragmentId String
Fragment id where the active preedit starts.
no setter
preeditLocalOffset int
Local offset where the active preedit starts.
no setter
preeditText String
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
shouldUseBufferSync bool
Public accessor so the editor shell knows whether backspace is handled via deltas (buffer-sync) rather than raw KeyEvent.
no setter

Methods

attachInput(FluentDocument document) → void
Attaches the IME connection to the given document.
commitIfComposing() → void
Commits any active preedit into the document. Safe to call even when no composition is active. Used on focus loss, connection close, enter key, send/done actions, etc.
connectionClosed() → void
Platform notified framework of closed connection.
override
detachInput() → void
Detaches and closes the IME connection.
didChangeInputControl(TextInputControl? oldControl, TextInputControl? newControl) → void
The framework calls this method to notify that the text input control has been changed.
override
hideKeyboard() → void
Hides the keyboard.
insertContent(KeyboardInsertedContent content) → void
Notify client about new content insertion from Android keyboard.
override
insertTextPlaceholder(Size size) → void
Requests that the client add a text placeholder to reserve visual space in the text.
override
isPreeditInContainer(String containerId) bool
Returns true if the given container id is the one hosting the active preedit.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onFocusReceived() bool
Notifies the client that the platform moved focus back to this input.
override
performAction(TextInputAction action) → void
Requests that this client perform the given action.
override
performPrivateCommand(String action, Map<String, dynamic> data) → void
Request from the input method that this client perform the given private command.
override
performSelector(String selectorName) → void
Performs the specified MacOS-specific selector from the NSStandardKeyBindingResponding protocol or user-specified selector from DefaultKeyBinding.Dict.
override
removeTextPlaceholder() → void
Requests that the client remove the text placeholder.
override
setViewHeight(double viewHeight) → void
Call this whenever the Flutter view height is known (e.g. in _updateImeCaretRect). Stores the height and re-sends the transform so the macOS plugin can map caret rect → screen rect correctly.
showAutocorrectionPromptRect(int start, int end) → void
Requests that this client display a prompt rectangle for the given text range, to indicate the range of text that will be changed by a pending autocorrection.
override
showKeyboard(BuildContext context) → void
Opens the keyboard (requests focus from the platform text input).
showToolbar() → void
Requests that the client show the editing toolbar, for example when the platform changes the selection through a non-flutter method such as scribble.
override
syncImeBufferToFragment() → void
Syncs the platform IME buffer with the current fragment text and cursor. Call after any document mutation or cursor move.
toString() String
A string representation of this object.
inherited
updateCaretRect(Rect rect) → void
Updates the caret rectangle so the platform can position the IME candidate window (e.g. NSTextInputContext on macOS) near the cursor. rect must be in Flutter view logical pixel coordinates.
updateEditingValue(TextEditingValue value, {int? cursorOffset}) → void
Requests that this client update its editing state to the given value.
override
updateEditingValueWithDeltas(List<TextEditingDelta> deltas) → void
Requests that this client update its editing state by applying the deltas received from the engine.
override
updateFloatingCursor(RawFloatingCursorPoint point) → void
Updates the floating cursor position and state.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited