pub struct TextInput<'a> { /* private fields */ }
Expand description
Text input widget.
§Stateful
This widget implements StatefulWidget
, you can use it with
TextInputState
to handle common actions.
Implementations§
Source§impl<'a> TextInput<'a>
impl<'a> TextInput<'a>
Sourcepub fn styles_opt(self, styles: Option<TextStyle>) -> Self
pub fn styles_opt(self, styles: Option<TextStyle>) -> Self
Set the combined style.
Sourcepub fn focus_style(self, style: impl Into<Style>) -> Self
pub fn focus_style(self, style: impl Into<Style>) -> Self
Style when focused.
Sourcepub fn select_style(self, style: impl Into<Style>) -> Self
pub fn select_style(self, style: impl Into<Style>) -> Self
Style for selection
Sourcepub fn invalid_style(self, style: impl Into<Style>) -> Self
pub fn invalid_style(self, style: impl Into<Style>) -> Self
Style for the invalid indicator. This is patched onto either base_style or focus_style
Sourcepub fn text_style<T: IntoIterator<Item = Style>>(self, styles: T) -> Self
pub fn text_style<T: IntoIterator<Item = Style>>(self, styles: T) -> Self
List of text-styles.
Use TextInputState::add_style() to refer a text range to one of these styles.
Sourcepub fn on_focus_gained(self, of: TextFocusGained) -> Self
pub fn on_focus_gained(self, of: TextFocusGained) -> Self
Focus behaviour
Sourcepub fn on_focus_lost(self, of: TextFocusLost) -> Self
pub fn on_focus_lost(self, of: TextFocusLost) -> Self
Focus behaviour
Trait Implementations§
Source§impl<'a> StatefulWidget for &TextInput<'a>
impl<'a> StatefulWidget for &TextInput<'a>
Source§impl StatefulWidget for TextInput<'_>
impl StatefulWidget for TextInput<'_>
Auto Trait Implementations§
impl<'a> Freeze for TextInput<'a>
impl<'a> RefUnwindSafe for TextInput<'a>
impl<'a> Send for TextInput<'a>
impl<'a> Sync for TextInput<'a>
impl<'a> Unpin for TextInput<'a>
impl<'a> UnwindSafe for TextInput<'a>
Blanket Implementations§
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more