Skip to main content

TextEditingControllerLeaf

Trait TextEditingControllerLeaf 

Source
pub trait TextEditingControllerLeaf:
    ChangeNotifier
    + Sized
    + 'static {
    // Required methods
    fn text_editing_controller_data(
        self: Handle<Self>,
        app: &App,
    ) -> &TextEditingControllerData;
    fn text_editing_controller_data_mut(
        self: Handle<Self>,
        app: &mut App,
    ) -> &mut TextEditingControllerData;

    // Provided methods
    fn build_text_span(
        self: Handle<Self>,
        app: &App,
        context: BuildContext,
        style: Option<TextStyle>,
        with_composing: bool,
    ) -> TextSpan { ... }
    fn text_value(self: Handle<Self>, app: &App) -> &str { ... }
    fn set_text(self: Handle<Self>, app: &mut App, new_text: impl Into<String>) { ... }
    fn value(self: Handle<Self>, app: &App) -> &TextEditingValue { ... }
    fn set_value(self: Handle<Self>, app: &mut App, new_value: TextEditingValue) { ... }
    fn selection(self: Handle<Self>, app: &App) -> TextSelection { ... }
    fn set_selection(
        self: Handle<Self>,
        app: &mut App,
        new_selection: TextSelection,
    ) { ... }
    fn clear(self: Handle<Self>, app: &mut App) { ... }
    fn clear_composing(self: Handle<Self>, app: &mut App) { ... }
    fn as_controller(self: Handle<Self>) -> AnyTextEditingController { ... }
}
Expand description

The trait every text-editing-controller leaf implements: TextEditingController, and a controller of an application’s own that changes how its text looks.

The virtual a leaf overrides is build_text_span; its shared body is TextEditingController::build_text_span, which an override calls where Dart writes super.buildTextSpan(…).

Required Methods§

Source

fn text_editing_controller_data( self: Handle<Self>, app: &App, ) -> &TextEditingControllerData

Dart’s TextEditingController fields, held under the field text_editing_controller (text_editing_controller_accessors!).

Source

fn text_editing_controller_data_mut( self: Handle<Self>, app: &mut App, ) -> &mut TextEditingControllerData

Provided Methods§

Source

fn build_text_span( self: Handle<Self>, app: &App, context: BuildContext, style: Option<TextStyle>, with_composing: bool, ) -> TextSpan

Builds TextSpan from current editing value.

By default makes text in composing range appear as underlined. Descendants can override this method to customize appearance of text.

Source

fn text_value(self: Handle<Self>, app: &App) -> &str

Source

fn set_text(self: Handle<Self>, app: &mut App, new_text: impl Into<String>)

Source

fn value(self: Handle<Self>, app: &App) -> &TextEditingValue

Source

fn set_value(self: Handle<Self>, app: &mut App, new_value: TextEditingValue)

Source

fn selection(self: Handle<Self>, app: &App) -> TextSelection

Source

fn set_selection( self: Handle<Self>, app: &mut App, new_selection: TextSelection, )

Source

fn clear(self: Handle<Self>, app: &mut App)

Source

fn clear_composing(self: Handle<Self>, app: &mut App)

Source

fn as_controller(self: Handle<Self>) -> AnyTextEditingController

This controller as the erased AnyTextEditingController: what to pass where a Dart API takes a TextEditingController.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§