Skip to main content

TextInputConfiguration

Struct TextInputConfiguration 

Source
pub struct TextInputConfiguration {
Show 19 fields pub view_id: Option<i32>, pub input_type: TextInputType, pub read_only: bool, pub obscure_text: bool, pub autocorrect: bool, pub smart_dashes_type: SmartDashesType, pub smart_quotes_type: SmartQuotesType, pub enable_suggestions: bool, pub enable_interactive_selection: bool, pub action_label: Option<String>, pub input_action: TextInputAction, pub text_capitalization: TextCapitalization, pub keyboard_appearance: Brightness, pub autofill_configuration: AutofillConfiguration, pub enable_ime_personalized_learning: bool, pub allowed_mime_types: Vec<String>, pub enable_delta_model: bool, pub hint_locales: Vec<Locale>, pub enable_inline_prediction: Option<bool>,
}
Expand description

Controls the visual appearance of the text input control.

Many TextInputActions are common between Android and iOS. However, if an input_action is provided that is not supported by the current platform in debug mode, an error will be thrown when the corresponding text input is attached. For example, providing iOS’s “emergencyCall” action when running on an Android device will result in an error when in debug mode. In release mode, incompatible TextInputActions are replaced either with “unspecified” on Android, or “default” on iOS. Appropriate input_actions can be chosen by checking the current platform and then selecting the appropriate action.

See also:

Fields§

§view_id: Option<i32>

The ID of the view that the text input belongs to.

§input_type: TextInputType

The type of information for which to optimize the text input control.

§read_only: bool

Whether the text field can be edited or not.

Defaults to false.

§obscure_text: bool

Whether to hide the text being edited (e.g., for passwords).

Defaults to false.

§autocorrect: bool

Whether to enable autocorrection.

Defaults to true.

§smart_dashes_type: SmartDashesType

Whether to allow the platform to automatically format dashes.

§smart_quotes_type: SmartQuotesType

Whether to allow the platform to automatically format quotes.

§enable_suggestions: bool

Whether to show input suggestions as the user types.

Defaults to true.

§enable_interactive_selection: bool

Whether a user can change its selection.

Defaults to true.

§action_label: Option<String>

What text to display in the text input control’s action button.

§input_action: TextInputAction

What kind of action to request for the action button on the IME.

§text_capitalization: TextCapitalization

Specifies how platforms may automatically capitalize text entered by the user.

Defaults to TextCapitalization::None.

§keyboard_appearance: Brightness

The appearance of the keyboard.

This setting is only honored on iOS devices.

Defaults to Brightness::Light.

§autofill_configuration: AutofillConfiguration

The configuration to use for autofill.

§enable_ime_personalized_learning: bool

Whether to enable that the IME update personalized data such as typing history and user dictionary data.

Defaults to true.

§allowed_mime_types: Vec<String>

MIME types the field accepts for content insertion.

§enable_delta_model: bool

Whether to enable that the engine sends text input updates to the framework as TextEditingDeltas or as one TextEditingValue.

Defaults to false.

§hint_locales: Vec<Locale>

List of the languages that the user is expected to use.

Pass an empty list to express the intention that a specific hint should not be set.

§enable_inline_prediction: Option<bool>

Whether to enable inline predictive text.

This feature is specific to iOS 17 and later. None leaves the platform default.

Implementations§

Source§

impl TextInputConfiguration

Source

pub fn builder() -> TextInputConfigurationBuilder

Starts configuration information for a text input control, with Dart’s defaults. Values left out are filled in by TextInputConfigurationBuilder::build, as Dart’s constructor fills them.

Source

pub fn copy_with(&self) -> TextInputConfigurationBuilder

Dart copyWith: a builder holding this configuration’s values, for fields to be replaced.

Trait Implementations§

Source§

impl Clone for TextInputConfiguration

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TextInputConfiguration

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for TextInputConfiguration

Source§

fn default() -> TextInputConfiguration

Returns the “default value” for a type. Read more
Source§

impl Display for TextInputConfiguration

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for TextInputConfiguration

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for TextInputConfiguration

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,