Skip to main content

TextInputFormatter

Trait TextInputFormatter 

Source
pub trait TextInputFormatter {
    // Required method
    fn format_edit_update(
        &self,
        old_value: &TextEditingValue,
        new_value: &TextEditingValue,
    ) -> TextEditingValue;
}
Expand description

A TextInputFormatter can be optionally injected into an EditableText to provide as-you-type validation and formatting of the text being edited.

Required Methods§

Source

fn format_edit_update( &self, old_value: &TextEditingValue, new_value: &TextEditingValue, ) -> TextEditingValue

Called when text is being typed or cut/copy/pasted in the EditableText.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§