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§
Sourcefn text_editing_controller_data(
self: Handle<Self>,
app: &App,
) -> &TextEditingControllerData
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!).
Sourcefn text_editing_controller_data_mut(
self: Handle<Self>,
app: &mut App,
) -> &mut TextEditingControllerData
fn text_editing_controller_data_mut( self: Handle<Self>, app: &mut App, ) -> &mut TextEditingControllerData
Provided Methods§
Sourcefn build_text_span(
self: Handle<Self>,
app: &App,
context: BuildContext,
style: Option<TextStyle>,
with_composing: bool,
) -> TextSpan
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.
Sourcefn text_value(self: Handle<Self>, app: &App) -> &str
fn text_value(self: Handle<Self>, app: &App) -> &str
Sourcefn value(self: Handle<Self>, app: &App) -> &TextEditingValue
fn value(self: Handle<Self>, app: &App) -> &TextEditingValue
Sourcefn set_value(self: Handle<Self>, app: &mut App, new_value: TextEditingValue)
fn set_value(self: Handle<Self>, app: &mut App, new_value: TextEditingValue)
Sourcefn selection(self: Handle<Self>, app: &App) -> TextSelection
fn selection(self: Handle<Self>, app: &App) -> TextSelection
Sourcefn set_selection(
self: Handle<Self>,
app: &mut App,
new_selection: TextSelection,
)
fn set_selection( self: Handle<Self>, app: &mut App, new_selection: TextSelection, )
Sourcefn clear_composing(self: Handle<Self>, app: &mut App)
fn clear_composing(self: Handle<Self>, app: &mut App)
Sourcefn as_controller(self: Handle<Self>) -> AnyTextEditingController
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".