Skip to main content

TextFieldConfig

Struct TextFieldConfig 

Source
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: bool

When false, the text field is not editable, not focusable, and input is not selectable (-> enabled).

§read_only: bool

When 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: TextStyle

Style for the text content (-> textStyle).

§keyboard_options: KeyboardOptions

Platform keyboard configuration hints (-> keyboardOptions).

§on_keyboard_action: Option<Rc<dyn KeyboardActionHandler>>

Per-action IME callback (-> onKeyboardAction).

§line_limits: TextFieldLineLimits

Line 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: TextObfuscationMode

Text obfuscation mode (-> textObfuscationMode). Used by BasicSecureTextField.

§text_obfuscation_character: char

Character 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

Source§

fn clone(&self) -> TextFieldConfig

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 Default for TextFieldConfig

Source§

fn default() -> Self

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

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<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> 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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.