pub struct TextInputType {
pub index: i32,
pub signed: Option<bool>,
pub decimal: Option<bool>,
pub password: Option<bool>,
}Expand description
The type of information for which to optimize the text input control.
On Android, behavior may vary across device and keyboard provider.
This class stays as close to Enum interface as possible, and allows
for additional flags for some input types. For example, numeric input
can specify whether it supports decimal numbers and/or signed numbers.
Fields§
§index: i32Enum value index, corresponds to one of the VALUES.
signed: Option<bool>The number is signed, allowing a positive or negative sign at the start.
This flag is only used for the NUMBER input type, otherwise None.
Use TextInputType::number_with_options().signed(true) to set this.
decimal: Option<bool>The number is decimal, allowing a decimal point to provide fractional.
This flag is only used for the NUMBER input type, otherwise None.
Use TextInputType::number_with_options().decimal(true) to set this.
password: Option<bool>The number is a password.
This flag is only used for the NUMBER input type, otherwise None.
Use TextInputType::number_with_options().password(true) to set this.
On Android, this adds TYPE_NUMBER_VARIATION_PASSWORD to the input type. It has no effect on iOS, web, or desktop platforms.
Implementations§
Source§impl TextInputType
impl TextInputType
Sourcepub const TEXT: TextInputType
pub const TEXT: TextInputType
Optimize for textual information.
Requests the default platform keyboard.
Sourcepub const MULTILINE: TextInputType
pub const MULTILINE: TextInputType
Optimize for multiline textual information.
Requests the default platform keyboard, but accepts newlines when the enter key is pressed. This is the input type used for all multiline text fields.
Sourcepub const NUMBER: TextInputType
pub const NUMBER: TextInputType
Optimize for unsigned numerical information without a decimal point.
Requests a default keyboard with ready access to the number keys.
Additional options, such as decimal point and/or positive/negative
signs, can be requested using number_with_options.
Sourcepub const PHONE: TextInputType
pub const PHONE: TextInputType
Optimize for telephone numbers.
Requests a keyboard with ready access to the number keys, “*”, and “#”.
Sourcepub const DATETIME: TextInputType
pub const DATETIME: TextInputType
Optimize for date and time information.
On iOS, requests the default keyboard.
On Android, requests a keyboard with ready access to the number keys, “:”, and “-”.
Sourcepub const EMAIL_ADDRESS: TextInputType
pub const EMAIL_ADDRESS: TextInputType
Optimize for email addresses.
Requests a keyboard with ready access to the “@” and “.” keys.
Sourcepub const URL: TextInputType
pub const URL: TextInputType
Optimize for URLs.
Requests a keyboard with ready access to the “/” and “.” keys.
Sourcepub const VISIBLE_PASSWORD: TextInputType
pub const VISIBLE_PASSWORD: TextInputType
Optimize for passwords that are visible to the user.
Requests a keyboard with ready access to both letters and numbers.
Sourcepub const NAME: TextInputType
pub const NAME: TextInputType
Optimized for a person’s name.
On iOS, requests the UIKeyboardType.namePhonePad keyboard, a keyboard optimized for entering a person’s name or phone number. Does not support auto-capitalization.
On Android, requests a keyboard optimized for TYPE_TEXT_VARIATION_PERSON_NAME.
Sourcepub const STREET_ADDRESS: TextInputType
pub const STREET_ADDRESS: TextInputType
Optimized for postal mailing addresses.
On iOS, requests the default keyboard.
On Android, requests a keyboard optimized for TYPE_TEXT_VARIATION_POSTAL_ADDRESS.
Sourcepub const NONE: TextInputType
pub const NONE: TextInputType
Prevent the OS from showing the on-screen virtual keyboard.
Sourcepub const WEB_SEARCH: TextInputType
pub const WEB_SEARCH: TextInputType
Optimized for web searches.
Requests a keyboard that includes keys useful for web searches as well as URLs.
On iOS, requests a default keyboard with ready access to the “.” key. In contrast to
URL, a space bar is available.
On Android this is remapped to the URL keyboard type as it always shows a space bar.
Sourcepub const TWITTER: TextInputType
pub const TWITTER: TextInputType
Optimized for social media.
Requests a keyboard that includes keys useful for handles and tags.
On iOS, requests a default keyboard with ready access to the “@” and “#” keys.
On Android this is remapped to the EMAIL_ADDRESS keyboard type as it always shows the “@” key.
Sourcepub const VALUES: &[TextInputType]
pub const VALUES: &[TextInputType]
All possible enum values.
Sourcepub const fn number_with_options() -> TextInputType
pub const fn number_with_options() -> TextInputType
Sourcepub fn signed(self, signed: bool) -> TextInputType
pub fn signed(self, signed: bool) -> TextInputType
Dart TextInputType.numberWithOptions(signed:).
Sourcepub fn decimal(self, decimal: bool) -> TextInputType
pub fn decimal(self, decimal: bool) -> TextInputType
Dart TextInputType.numberWithOptions(decimal:).
Sourcepub fn password(self, password: bool) -> TextInputType
pub fn password(self, password: bool) -> TextInputType
Dart TextInputType.numberWithOptions(password:).
Trait Implementations§
Source§impl Clone for TextInputType
impl Clone for TextInputType
Source§fn clone(&self) -> TextInputType
fn clone(&self) -> TextInputType
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for TextInputType
Source§impl Debug for TextInputType
impl Debug for TextInputType
Source§impl Display for TextInputType
impl Display for TextInputType
impl Eq for TextInputType
Source§impl Hash for TextInputType
impl Hash for TextInputType
Source§impl PartialEq for TextInputType
impl PartialEq for TextInputType
impl StructuralPartialEq for TextInputType
Auto Trait Implementations§
impl Freeze for TextInputType
impl RefUnwindSafe for TextInputType
impl Send for TextInputType
impl Sync for TextInputType
impl Unpin for TextInputType
impl UnsafeUnpin for TextInputType
impl UnwindSafe for TextInputType
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
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§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.