text_input_formatter_kit 0.1.1
text_input_formatter_kit: ^0.1.1 copied to clipboard
A lightweight and utility-driven package offering custom TextInputFormatter implementations to enhance and standardize user input in Flutter forms.
🎨 Text Input Formatter Kit #
text_input_formatter_kit is a lightweight and utility-driven package offering custom TextInputFormatter implementations to enhance and standardize user input in Flutter forms.
Features ✨ #
- NoLeadingWhitespaceFormatter: Removes leading whitespace from user input. 📝
- 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. 🔢🔠
Getting Started 💻 #
❗ 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>[
// Removes leading whitespace from user input
NoLeadingWhitespaceFormatter(),
// 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.
Demo #
Contribution 🤝 #
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.