pub struct AnyTextEditingController { /* private fields */ }Expand description
Erased TextEditingControllerLeaf: what a field or parameter Dart types as
TextEditingController becomes.
Equality is Dart’s == on an object reference.
Implementations§
Source§impl AnyTextEditingController
impl AnyTextEditingController
Sourcepub fn upgrade(self, app: &App) -> Option<Retained<AnyTextEditingController>>
pub fn upgrade(self, app: &App) -> Option<Retained<AnyTextEditingController>>
A reference while something still keeps the object, None once it is freed or
its last keeper has let go; see Handle::upgrade.
Sourcepub fn keep(self, app: &App) -> Retained<AnyTextEditingController>
pub fn keep(self, app: &App) -> Retained<AnyTextEditingController>
A reference to an object something is known to keep; see
Handle::keep.
Source§impl AnyTextEditingController
impl AnyTextEditingController
Sourcepub fn identity_hash(self) -> u64
pub fn identity_hash(self) -> u64
The identity a dump shows.
Sourcepub fn to_string(self, app: &App) -> String
pub fn to_string(self, app: &App) -> String
Dart’s TextEditingController.toString, which it inherits from ValueNotifier:
TextEditingController#1a2b3(TextEditingValue(...)).
Sourcepub fn text_value(self, app: &App) -> &str
pub fn text_value(self, app: &App) -> &str
The current string the user is editing.
Sourcepub fn set_text(self, app: &mut App, new_text: impl Into<String>)
pub fn set_text(self, app: &mut App, new_text: impl Into<String>)
Updates the current text to the given new_text, and removes existing
selection and composing range held by the controller.
This setter is typically only used in tests, as it resets the cursor
position and the composing state. For production code, consider using the
value setter to update the text value instead, and specify a
reasonable selection range within the new text.
Sourcepub fn value(self, app: &App) -> &TextEditingValue
pub fn value(self, app: &App) -> &TextEditingValue
The current TextEditingValue.
Sourcepub fn set_value(self, app: &mut App, new_value: TextEditingValue)
pub fn set_value(self, app: &mut App, new_value: TextEditingValue)
Setting this does not run TextInputFormatters. Apply them manually if
needed.
Sourcepub fn build_text_span(
self,
app: &App,
context: BuildContext,
style: Option<TextStyle>,
with_composing: bool,
) -> TextSpan
pub fn build_text_span( self, app: &App, context: BuildContext, style: Option<TextStyle>, with_composing: bool, ) -> TextSpan
Sourcepub fn selection(self, app: &App) -> TextSelection
pub fn selection(self, app: &App) -> TextSelection
The currently selected range within text_value.
If the selection is collapsed, then this property gives the offset of the cursor within the text.
Sourcepub fn set_selection(self, app: &mut App, new_selection: TextSelection)
pub fn set_selection(self, app: &mut App, new_selection: TextSelection)
Sets the selection. If the new selection is outside the composing range, the composing range is cleared.
Panics when the selection falls outside the text.
Sourcepub fn clear(self, app: &mut App)
pub fn clear(self, app: &mut App)
Set the value to empty.
After calling this function, text_value will be the empty string
and the selection will be collapsed at zero offset.
Sourcepub fn clear_composing(self, app: &mut App)
pub fn clear_composing(self, app: &mut App)
Set the composing region to an empty range.
The composing region is the range of text that is still being composed. Calling this function indicates that the user is done composing that region.
Sourcepub fn describe(self, app: &App) -> String
pub fn describe(self, app: &App) -> String
Dart’s toString, which reads the arena and so cannot be std::fmt::Debug.
Source§impl AnyTextEditingController
impl AnyTextEditingController
Sourcepub fn add_listener(self, app: &mut App, listener: Listener)
pub fn add_listener(self, app: &mut App, listener: Listener)
Sourcepub fn remove_listener(self, app: &mut App, listener: &Listener)
pub fn remove_listener(self, app: &mut App, listener: &Listener)
Trait Implementations§
Source§impl Clone for AnyTextEditingController
impl Clone for AnyTextEditingController
impl Copy for AnyTextEditingController
Source§impl Debug for AnyTextEditingController
impl Debug for AnyTextEditingController
impl Eq for AnyTextEditingController
Source§impl From<AnyTextEditingController> for HandleId
impl From<AnyTextEditingController> for HandleId
Source§fn from(handle: AnyTextEditingController) -> HandleId
fn from(handle: AnyTextEditingController) -> HandleId
Source§impl<Leaf: TextEditingControllerLeaf> From<Handle<Leaf>> for AnyTextEditingController
impl<Leaf: TextEditingControllerLeaf> From<Handle<Leaf>> for AnyTextEditingController
Source§fn from(handle: Handle<Leaf>) -> AnyTextEditingController
fn from(handle: Handle<Leaf>) -> AnyTextEditingController
Source§impl Hash for AnyTextEditingController
impl Hash for AnyTextEditingController
Source§impl ListenableHandle for AnyTextEditingController
impl ListenableHandle for AnyTextEditingController
Source§fn add_listener_to(self, app: &mut App, listener: Listener)
fn add_listener_to(self, app: &mut App, listener: Listener)
Source§fn remove_listener_from(self, app: &mut App, listener: &Listener)
fn remove_listener_from(self, app: &mut App, listener: &Listener)
Source§impl PartialEq for AnyTextEditingController
impl PartialEq for AnyTextEditingController
Source§impl ValueListenableHandle<TextEditingValue> for AnyTextEditingController
impl ValueListenableHandle<TextEditingValue> for AnyTextEditingController
Source§fn value_of(self, app: &App) -> &TextEditingValue
fn value_of(self, app: &App) -> &TextEditingValue
Auto Trait Implementations§
impl Forget for AnyTextEditingController
impl Freeze for AnyTextEditingController
impl Move for AnyTextEditingController
impl RefUnwindSafe for AnyTextEditingController
impl Send for AnyTextEditingController
impl Sync for AnyTextEditingController
impl Unpin for AnyTextEditingController
impl UnsafeUnpin for AnyTextEditingControllerwhere
NonZeroU32Inner: UnsafeUnpin,
&'static TextEditingControllerVTable: UnsafeUnpin,
impl UnwindSafe for AnyTextEditingController
Blanket Implementations§
Source§impl<T> AnyEq for T
impl<T> AnyEq for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.