ImeSession class
Owns the platform TextInput connection for the terminal view. Parses
updateEditingValue into events the rest of the app cares about:
onPreeditChanged(String?) — the current composing substring (null = no active preedit; the overlay should hide). onCommit(String) — a finalized string the terminal should write to the PTY as UTF-8 bytes. onBackspace() — delete key while the TextInput buffer shrinks.
Per-frame, the caller should pass cursor geometry via setImeGeometry so the OS IM (fcitx / IBus / macOS IME / etc.) positions its candidate window adjacent to the cursor cell.
- Implemented types
Constructors
- ImeSession({required void onCommit(String text), required void onPreeditChanged(String? preedit), required void onBackspace()})
Properties
- 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
- hashCode → int
-
The hash code for this object.
no setterinherited
- isAttached → bool
-
no setter
- isComposing → bool
-
True while the platform IM has an active composing range (preedit).
no setter
- onBackspace → void Function()
-
final
- onCommit → void Function(String text)
-
final
- onPreeditChanged → void Function(String? preedit)
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
attach(
) → void - Open a platform TextInput session. Idempotent.
-
connectionClosed(
) → void -
Platform notified framework of closed connection.
override
-
detach(
{bool notify = true}) → void -
Close the session and clear any visible preedit. Safe to call when not
attached.
notify— when false, skip onPreeditChanged (e.g. widgetdispose). -
didChangeInputControl(
TextInputControl? old, TextInputControl? n) → void -
The framework calls this method to notify that the text input control has
been changed.
override
-
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
-
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
NSStandardKeyBindingRespondingprotocol or user-specified selector fromDefaultKeyBinding.Dict.override -
removeTextPlaceholder(
) → void -
Requests that the client remove the text placeholder.
override
-
resetComposing(
{bool notify = true}) → void - Abandon any in-flight composition and restore the baseline editing state WITHOUT closing the platform connection. Used when the host swaps the engine under a reused view — the stale pre-edit must not commit into the newly swapped-in engine.
-
setImeGeometry(
{required Size editableSize, required Matrix4 editableTransform, required Rect globalCaret}) → void - Positions the platform IME: editable bounds + caret (global coordinates).
-
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
-
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
-
toString(
) → String -
A string representation of this object.
inherited
-
updateEditingValue(
TextEditingValue value) → void -
Requests that this client update its editing state to the given value.
override
-
updateFloatingCursor(
RawFloatingCursorPoint point) → void -
Updates the floating cursor position and state.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited