pub trait TextInputHost {
// Required methods
fn start(&self, configuration: &TextInputConfiguration);
fn stop(&self);
fn set_editing_state(&self, value: &TextEditingValue);
fn set_composing_rect(&self, rect: Rect);
fn set_caret_rect(&self, rect: Rect);
fn set_client_geometry(&self, size: Size, transform: &Matrix4);
// Provided method
fn handles_editing_keys(&self) -> bool { ... }
}Expand description
The host side of Flutter’s text input connection for one view.
Required Methods§
Sourcefn start(&self, configuration: &TextInputConfiguration)
fn start(&self, configuration: &TextInputConfiguration)
Flutter TextInput.attach / TextInputConnection.show: start an IME
session for this view.
Sourcefn set_editing_state(&self, value: &TextEditingValue)
fn set_editing_state(&self, value: &TextEditingValue)
Flutter TextInputConnection.setEditingState.
Sourcefn set_composing_rect(&self, rect: Rect)
fn set_composing_rect(&self, rect: Rect)
Flutter TextInput.setComposingRect.
Sourcefn set_caret_rect(&self, rect: Rect)
fn set_caret_rect(&self, rect: Rect)
Flutter TextInput.setCaretRect.
Sourcefn set_client_geometry(&self, size: Size, transform: &Matrix4)
fn set_client_geometry(&self, size: Size, transform: &Matrix4)
Flutter TextInput.setEditableSizeAndTransform.
Provided Methods§
Sourcefn handles_editing_keys(&self) -> bool
fn handles_editing_keys(&self) -> bool
Whether this text input turns editing keys into edits before the framework sees them: backspace and delete, caret movement, the line and document ends.
Flutter has no such question because each of its embedders is written for one host: its macOS and iOS embedders do interpret those keys, and its text field bindings for those platforms step aside so a key is not acted on twice.
Defaults to false, which is what a host built on a windowing library that reports plain key presses should answer, whichever platform it runs on. A host that hands the framework the operating system’s own editing commands answers true, and the field then leaves those keys to it.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".