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 new() -> TextInputConfiguration
pub fn new() -> TextInputConfiguration
Creates configuration information for a text input control.
Sourcepub fn view_id(self, view_id: i32) -> TextInputConfiguration
pub fn view_id(self, view_id: i32) -> TextInputConfiguration
Dart TextInputConfiguration(viewId:).
Sourcepub fn input_type(self, input_type: TextInputType) -> TextInputConfiguration
pub fn input_type(self, input_type: TextInputType) -> TextInputConfiguration
Dart TextInputConfiguration(inputType:).
Sourcepub fn read_only(self, read_only: bool) -> TextInputConfiguration
pub fn read_only(self, read_only: bool) -> TextInputConfiguration
Dart TextInputConfiguration(readOnly:).
Sourcepub fn obscure_text(self, obscure_text: bool) -> TextInputConfiguration
pub fn obscure_text(self, obscure_text: bool) -> TextInputConfiguration
Dart TextInputConfiguration(obscureText:).
Sourcepub fn autocorrect(self, autocorrect: bool) -> TextInputConfiguration
pub fn autocorrect(self, autocorrect: bool) -> TextInputConfiguration
Dart TextInputConfiguration(autocorrect:).
Sourcepub fn smart_dashes_type(
self,
smart_dashes_type: SmartDashesType,
) -> TextInputConfiguration
pub fn smart_dashes_type( self, smart_dashes_type: SmartDashesType, ) -> TextInputConfiguration
Dart TextInputConfiguration(smartDashesType:).
Sourcepub fn smart_quotes_type(
self,
smart_quotes_type: SmartQuotesType,
) -> TextInputConfiguration
pub fn smart_quotes_type( self, smart_quotes_type: SmartQuotesType, ) -> TextInputConfiguration
Dart TextInputConfiguration(smartQuotesType:).
Sourcepub fn enable_suggestions(
self,
enable_suggestions: bool,
) -> TextInputConfiguration
pub fn enable_suggestions( self, enable_suggestions: bool, ) -> TextInputConfiguration
Dart TextInputConfiguration(enableSuggestions:).
Sourcepub fn enable_interactive_selection(
self,
enable_interactive_selection: bool,
) -> TextInputConfiguration
pub fn enable_interactive_selection( self, enable_interactive_selection: bool, ) -> TextInputConfiguration
Dart TextInputConfiguration(enableInteractiveSelection:).
Sourcepub fn action_label(
self,
action_label: impl Into<String>,
) -> TextInputConfiguration
pub fn action_label( self, action_label: impl Into<String>, ) -> TextInputConfiguration
Dart TextInputConfiguration(actionLabel:).
Sourcepub fn input_action(
self,
input_action: TextInputAction,
) -> TextInputConfiguration
pub fn input_action( self, input_action: TextInputAction, ) -> TextInputConfiguration
Dart TextInputConfiguration(inputAction:).
Sourcepub fn keyboard_appearance(
self,
keyboard_appearance: Brightness,
) -> TextInputConfiguration
pub fn keyboard_appearance( self, keyboard_appearance: Brightness, ) -> TextInputConfiguration
Dart TextInputConfiguration(keyboardAppearance:).
Sourcepub fn text_capitalization(
self,
text_capitalization: TextCapitalization,
) -> TextInputConfiguration
pub fn text_capitalization( self, text_capitalization: TextCapitalization, ) -> TextInputConfiguration
Dart TextInputConfiguration(textCapitalization:).
Sourcepub fn autofill_configuration(
self,
autofill_configuration: AutofillConfiguration,
) -> TextInputConfiguration
pub fn autofill_configuration( self, autofill_configuration: AutofillConfiguration, ) -> TextInputConfiguration
Dart TextInputConfiguration(autofillConfiguration:).
Sourcepub fn enable_ime_personalized_learning(
self,
enable_ime_personalized_learning: bool,
) -> TextInputConfiguration
pub fn enable_ime_personalized_learning( self, enable_ime_personalized_learning: bool, ) -> TextInputConfiguration
Dart TextInputConfiguration(enableIMEPersonalizedLearning:).
Sourcepub fn allowed_mime_types(
self,
allowed_mime_types: Vec<String>,
) -> TextInputConfiguration
pub fn allowed_mime_types( self, allowed_mime_types: Vec<String>, ) -> TextInputConfiguration
Dart TextInputConfiguration(allowedMimeTypes:).
Sourcepub fn enable_delta_model(
self,
enable_delta_model: bool,
) -> TextInputConfiguration
pub fn enable_delta_model( self, enable_delta_model: bool, ) -> TextInputConfiguration
Dart TextInputConfiguration(enableDeltaModel:).
Sourcepub fn hint_locales(self, hint_locales: Vec<Locale>) -> TextInputConfiguration
pub fn hint_locales(self, hint_locales: Vec<Locale>) -> TextInputConfiguration
Dart TextInputConfiguration(hintLocales:).
Sourcepub fn enable_inline_prediction(
self,
enable_inline_prediction: bool,
) -> TextInputConfiguration
pub fn enable_inline_prediction( self, enable_inline_prediction: bool, ) -> TextInputConfiguration
Dart TextInputConfiguration(enableInlinePrediction:).
Sourcepub fn copy_with(&self) -> TextInputConfiguration
pub fn copy_with(&self) -> TextInputConfiguration
Creates a copy of this TextInputConfiguration with the given fields
replaced with new values.
Trait Implementations§
Source§impl Clone for TextInputConfiguration
impl Clone for TextInputConfiguration
Source§fn clone(&self) -> TextInputConfiguration
fn clone(&self) -> TextInputConfiguration
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more