text_input_formatter_kit is a lightweight and utility-driven package offering custom TextInputFormatter implementations to enhance and standardize user input in Flutter forms.
- CapitalizeTextFormatter: Capitalizes the first letter of each word in the input text.
🅰️ - LowerCaseTextFormatter: Converts all input text to lowercase. 🔠
- NoEmojiTextInputFormatter: Restricts input to exclude emojis. 🚫😊
- ReplaceWhiteSpaceTextInputFormatter: Replaces all spaces with a specified character. 🔄
- RestrictDigitsAndSpecialCharactersTextInputFormatter: Excludes digits and special characters. 🚫🔢
- SpacerInputFormatter: Adds a space after every specified number of characters. 🔢🔠
❗ In order to start using Text Input Formatter Kit you must have the Flutter SDK installed on your machine.
Install via flutter pub add
:
dart pub add text_input_formatter_kit
import 'package:text_input_formatter_kit/text_input_formatter_kit.dart';
TextField(
inputFormatters: <TextInputFormatter>[
// Capitalizes the first letter of each word
CapitalizeTextFormatter(),
// Converts all input text to lowercase
LowerCaseTextFormatter(),
// Restricts input to exclude emojis
NoEmojiTextInputFormatter(),
// Replaces spaces with underscore
ReplaceWhiteSpaceTextInputFormatter(replacementChar: '_'),
// Excludes digits and special characters
RestrictDigitsAndSpecialCharactersTextInputFormatter(),
// Adds a space after every 4 characters
SpacerInputFormatter(spaceEvery: 4),
],
);
See example
folder for more examples.
Contributions are welcome! If you have suggestions for new formatters or improvements to existing ones, feel free to create an issue or submit a pull request.