GuestTextInput class

The guest's text input — what lets a demo's TextField receive typing.

The guest has no platform text input: the host is a few hundred lines of C with nothing on the other end of flutter/textinput, so the platform control's messages go into the void and no field could ever receive a character. This control replaces it (TextInput.setInputControl) and builds the editing state in Dart instead, from the key events the GUI already forwards — each carrying the character the host's keyboard layout resolved it to.

It owns two things, and the second is the one that surprises: insertion, and the editing commands. On Apple platforms the framework refuses to act on backspace, delete, the arrows, home, end and page while a field is focused, and waits for the platform to name the command instead — see _selectorFor. So a guest doing only insertion gets a field that can be typed into and never corrected.

The chords stay the framework's: ⌘A, ⌘C, ⌘Z and the rest are not disabled, and resolve as ordinary shortcuts once the panel forwards them — see isReservedAppChord on the host side, which decides what a demo is allowed to hear.

What stays missing is composition: dead keys (⌥e → é) and CJK need a real IME, which means proxying the host's, which is not built.

Mixed-in types

Properties

asking → ValueNotifier<KeyboardVariant?>
What keyboard the platform would be showing right now, or null for none.
final
focused → bool
Whether a field has focus: somewhere fill can put what it is given.
no setter
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

attach(TextInputClient client, TextInputConfiguration configuration) → void
Requests the text input control to attach to the given input client.
override
detach(TextInputClient client) → void
Requests the text input control to detach from the given input client.
override
dismiss() → void
What a platform does when the user closes the IME without touching the app — the swipe-down on Android, the dismiss key on an iPad, and the one gesture that takes a keyboard away from outside the app.
fill(String text) → bool
Fills the focused field with text, as a platform's autofill does — a one-time code offered from an SMS — replacing what it held. False when no field has focus: there is nowhere for it to go.
finishAutofillContext({bool shouldSave = true}) → void
Requests that the autofill context is finalized.
inherited
hide() → void
Requests that the text input control is hidden.
override
install() → void
Replaces the platform control. Call once, before runApp.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
requestAutofill() → void
Requests autofill from the text input control.
inherited
setCaretRect(Rect rect) → void
Informs the text input control about caret area changes.
inherited
setComposingRect(Rect rect) → void
Informs the text input control about composing area changes.
inherited
setEditableSizeAndTransform(Size editableBoxSize, Matrix4 transform) → void
Informs the text input control about client position changes.
inherited
setEditingState(TextEditingValue value) → void
Informs the text input control about editing state changes.
override
setSelectionRects(List<SelectionRect> selectionRects) → void
Informs the text input control about selection area changes.
inherited
setStyle({required String? fontFamily, required double? fontSize, required FontWeight? fontWeight, required TextDirection textDirection, required TextAlign textAlign}) → void
Informs the text input control about text style changes.
inherited
show() → void
Requests that the text input control is shown.
override
toString() → String
A string representation of this object.
inherited
updateConfig(TextInputConfiguration configuration) → void
Informs the text input control about input configuration changes.
override
updateStyle(TextInputStyle style) → void
Informs the text input control about text style changes.
inherited

Operators

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

Static Properties

instance → GuestTextInput
final