Skip to content

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

License

Notifications You must be signed in to change notification settings

RounakTadvi/text_input_formatter_kit

Repository files navigation

🎨 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 ✨

  • 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>[
    // 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.

About

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

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published