text_input_pro 0.0.2

SDKflutter
Platformandroidioswindowslinuxmacosweb

Text Input Box with in-build validators

Text Input Pro

Flutter text input box with various validator like required validator, minimum char validator, maximum char validator, email validator and so on.

The package is currently in the development phase 🐞

Installing:

In your pubspec.yaml file add text_input_pro dependency.

dependencies:
  text_input_pro: <latest_version>

Run pub get to get the dependencies.

flutter pub get

Usage

The TextInput is a root widget and it will display TextFormField on the UI. It will automatically validate the user inputs and will react based on the validators.

body: Center(
        child: Column(
          mainAxisSize: MainAxisSize.min,
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            TextInput(
              TextEditingController(),
              "Text Input Example",
              validators: [
                RequiredValidator(errorText: "Required"),
                MinimumValidator(5, errorText: "Input is too short :("),
                MaximumValidator(30, errorText: "Input is too long :("),
              ],
            ),
          ],
        ),
      )

Validators

NameDescriptionArguments Description
RequiredValidatorChecks if input is providederrorText - Error message to display
MinimumValidatorEnsures minimum characters are providedmin - Minimum required length
errorText - Error message to display
MaximumValidatorEnsures maximum characters are not exceededmax - Maximum allowed length
errorText - Error message to display
EmailValidatorValidates if the input is a valid emailerrorText - Error message to display
RegExpValidatorChecks if input matches a regular expressionexp - Regular Expression
errorText - Error message to display
NumOnlyValidatorEnsures input contains only numberserrorText - Error message to display
LettersOnlyValidatorEnsures input contains only alphabetserrorText - Error message to display

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details