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:
TextInput.attachTextInputAction
Fields§
§view_id: Option<i32>The ID of the view that the text input belongs to.
input_type: TextInputTypeThe type of information for which to optimize the text input control.
read_only: boolWhether the text field can be edited or not.
Defaults to false.
obscure_text: boolWhether to hide the text being edited (e.g., for passwords).
Defaults to false.
autocorrect: boolWhether to enable autocorrection.
Defaults to true.
smart_dashes_type: SmartDashesTypeWhether to allow the platform to automatically format dashes.
smart_quotes_type: SmartQuotesTypeWhether to allow the platform to automatically format quotes.
enable_suggestions: boolWhether to show input suggestions as the user types.
Defaults to true.
enable_interactive_selection: boolWhether 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: TextInputActionWhat kind of action to request for the action button on the IME.
text_capitalization: TextCapitalizationSpecifies how platforms may automatically capitalize text entered by the user.
Defaults to TextCapitalization::None.
keyboard_appearance: BrightnessThe appearance of the keyboard.
This setting is only honored on iOS devices.
Defaults to Brightness::Light.
autofill_configuration: AutofillConfigurationThe configuration to use for autofill.
enable_ime_personalized_learning: boolWhether 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: boolWhether 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
impl TextInputConfiguration
Sourcepub fn builder() -> TextInputConfigurationBuilder
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.
Sourcepub fn copy_with(&self) -> TextInputConfigurationBuilder
pub fn copy_with(&self) -> TextInputConfigurationBuilder
Dart copyWith: a builder holding this configuration’s values, for fields to be
replaced.