pub struct TextFieldConfig {Show 19 fields
pub enabled: bool,
pub read_only: bool,
pub input_transformation: Option<Rc<dyn InputTransformation>>,
pub text_style: TextStyle,
pub keyboard_options: KeyboardOptions,
pub on_keyboard_action: Option<Rc<dyn KeyboardActionHandler>>,
pub line_limits: TextFieldLineLimits,
pub on_text_layout: Option<Rc<dyn Fn(&TextLayoutResult)>>,
pub interaction_source: Option<MutableInteractionSource>,
pub cursor_brush: Option<Brush>,
pub output_transformation: Option<Rc<dyn OutputTransformation>>,
pub decorator: Option<Rc<dyn TextFieldDecorator>>,
pub codepoint_transformation: Option<CodepointTransformation>,
pub text_obfuscation_mode: TextObfuscationMode,
pub text_obfuscation_character: char,
pub on_change: Option<Rc<dyn Fn(String)>>,
pub on_submit: Option<Rc<dyn Fn(String)>>,
pub visual_transformation: Option<Rc<dyn VisualTransformation>>,
pub decoration_box: Option<Rc<dyn Fn(View) -> View>>,
}Expand description
Configuration for BasicTextField / BasicSecureTextField.
Use ..Default::default() for unset fields:
BasicTextField(state, modifier, "Hint", TextFieldConfig {
enabled: false,
..Default::default()
})Fields§
§enabled: boolWhen false, the text field is not editable, not focusable, and input is not selectable (-> enabled).
read_only: boolWhen true, the text field can be focused and text can be selected/copied, but not modified (-> readOnly).
input_transformation: Option<Rc<dyn InputTransformation>>Input transformation (-> inputTransformation). Transforms text before it is applied.
text_style: TextStyleStyle for the text content (-> textStyle).
keyboard_options: KeyboardOptionsPlatform keyboard configuration hints (-> keyboardOptions).
on_keyboard_action: Option<Rc<dyn KeyboardActionHandler>>Per-action IME callback (-> onKeyboardAction).
line_limits: TextFieldLineLimitsLine limits (-> TextFieldLineLimits).
on_text_layout: Option<Rc<dyn Fn(&TextLayoutResult)>>Callback invoked after each text layout computation (-> onTextLayout).
interaction_source: Option<MutableInteractionSource>Interaction source for tracking focus/press/hover state.
cursor_brush: Option<Brush>Cursor brush (-> cursorBrush). None → theme default (on_surface).
output_transformation: Option<Rc<dyn OutputTransformation>>Output transformation (-> outputTransformation). Transforms text for display only.
decorator: Option<Rc<dyn TextFieldDecorator>>Decorator (-> decorator). Wraps the inner text field with custom decorations.
codepoint_transformation: Option<CodepointTransformation>Internal codepoint transformation for password obfuscation (-> codepointTransformation).
text_obfuscation_mode: TextObfuscationModeText obfuscation mode (-> textObfuscationMode). Used by BasicSecureTextField.
text_obfuscation_character: charCharacter used for text obfuscation (-> textObfuscationCharacter). Used by BasicSecureTextField.
on_change: Option<Rc<dyn Fn(String)>>§on_submit: Option<Rc<dyn Fn(String)>>§visual_transformation: Option<Rc<dyn VisualTransformation>>§decoration_box: Option<Rc<dyn Fn(View) -> View>>Trait Implementations§
Source§impl Clone for TextFieldConfig
impl Clone for TextFieldConfig
Source§fn clone(&self) -> TextFieldConfig
fn clone(&self) -> TextFieldConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more