text_input_formatter_kit 0.1.1 copy "text_input_formatter_kit: ^0.1.1" to clipboard
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 #

style: very good analysis codecov License: MIT

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 #

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.

6
likes
160
points
38
downloads

Publisher

unverified uploader

Weekly Downloads

A lightweight and utility-driven package offering custom TextInputFormatter implementations to enhance and standardize user input in Flutter forms.

Homepage
Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on text_input_formatter_kit