
β¨ TextInputFormatters Included
A collection of custom TextInputFormatter
s designed to enhance and control user input in Flutter apps.
π Typing Delay Formatter
Mimics human-like typing latency by preventing direct typing and simulating delayed character-by-character input.
/// Example:
TypingDelayController typingController = TypingDelayController();
TextField(
controller: typingController,
onChanged: (value) {
if (!typingController.text.endsWith(value.characters.last)) {
typingController.typeCharacter(value.characters.last);
}
},
)
π’ Digits Only Formatter
Allows only numeric digits (0β9).
/// Example:
TextField(
inputFormatters: [DigitsOnlyFormatter()],
)
π Input Mirror Formatter
Reverses the text in real-time as the user types.
/// Example:
TextField(
inputFormatters: [InputMirrorFormatter()],
)
Input: hello
β Displayed: olleh
π« Prevent Repeat Characters
Blocks repeated characters (e.g., aa
β a
).
/// Example:
TextField(
inputFormatters: [PreventRepeatCharactersFormatter()],
)
βοΈ Block Clipboard Access
Disables pasting text into the field via the clipboard.
/// Example:
TextField(
inputFormatters: [BlockClipboardFormatter()],
)
πͺ Only Palindromes Allowed
Allows only input that is a valid palindrome (same forwards and backwards).
/// Example:
TextField(
inputFormatters: [PalindromeOnlyFormatter()],
)
Allowed Input: madam
, racecar
Blocked Input: hello
, world
π‘ Only Alphabets
Removes digits and symbols, allowing only alphabetic input.
/// Example:
TextField(
inputFormatters: [OnlyAlphabetsFormatter()],
)
Input: abc123@#
β Output: abc
π« CamelCase Formatter
Converts the input to camelCase format.
/// Example:
TextField(
inputFormatters: [CamelCaseInputFormatter()],
)
Input: hello world flutter
β Output: helloWorldFlutter
π Snake_case Formatter
Automatically formats input to snake_case
.
/// Example:
TextField(
inputFormatters: [SnakeCaseInputFormatter()],
)
Input: hello world
β Output: hello_world
β Kebab-case Formatter
Automatically formats input to kebab-case
.
/// Example:
TextField(
inputFormatters: [KebabCaseInputFormatter()],
)
Input: hello world
β Output: hello-world
β Replace Whitespace With Underscores
Replaces all spaces with underscores.
/// Example:
TextField(
inputFormatters: [WhitespaceToUnderscoreFormatter()],
)
Input: hello world flutter
β Output: hello_world_flutter
π« Prevent Multiple Consecutive Spaces
Ensures no more than one space between words.
/// Example:
TextField(
inputFormatters: [SingleSpaceFormatter()],
)
Input: hello world
β Output: hello world
π¨βπ» Maintainer
Developed with π by Katayath Sai Kiran π¬ Feel free to contribute or suggest improvements!
Libraries
- advanced_text_input_formatters_codespark
- controllers/typing_delay_controller
- formatters/camel_case_formatter
- formatters/digits_only_formatter
- formatters/kebab_case_formatter
- formatters/mirror_text_formatter
- formatters/no_paste_formatter
- formatters/no_repeat_characters_formatter
- formatters/only_alphabets_formatter
- formatters/palindrome_only_formatter
- formatters/prevent_multiple_spaces_formatter
- formatters/replace_whitespace_with_underscore_formatter
- formatters/snake_case_formatter