flutter_textfield_validation 0.0.2 icon indicating copy to clipboard operation
flutter_textfield_validation: ^0.0.2 copied to clipboard

a flutter package for validation

Fancy Containers #

flutter textfield validation lets you validate different textform fields in your Flutter app.

Installation #

  1. Add the latest version of package to your pubspec.yaml (and rundart pub get):
dependencies:
  flutter_textfield_validation: ^0.0.1
  1. Import the package and use it in your Flutter App.
import 'package:flutter_textfield_validation/flutter_textfield_validation.dart';

Example #

There are a number of properties that you can modify:

  1. Email Validation validateEmail() 2.Password Validation validatePassword() 3.Name Validation validateName() 4.Phone Validation validatePhone() 5.Otp Validation validateOtp() 6.Dob Validation validateDob() 7.Country code Validation validateCountryCode1() 8.State code Validation validateState() 9.City code Validation validateCity() 10.Pin code Validation validatePincode() 11.Post code Validation validatePostCode() 12.Address Validation validateAddress()

TextFormField(
                    controller: _emailController,
                    autovalidateMode: AutovalidateMode.onUserInteraction,
                    validator: (input) => input!.validateEmail()
                        ? null
                        : "Please enter valid email!!",
                    decoration: InputDecoration(
                        enabledBorder: const OutlineInputBorder(
                          borderRadius: BorderRadius.all(Radius.circular(12.0)),
                          borderSide:
                              BorderSide(color: Colors.transparent, width: 2),
                        ),
                        focusedBorder: const OutlineInputBorder(
                          borderRadius: BorderRadius.all(Radius.circular(10.0)),
                          borderSide: BorderSide(color: Colors.transparent),
                        ),
                        border: InputBorder.none,
                        filled: true,
                       // prefixIcon: const Icon(Icons.mail),
                        hintStyle: TextStyle(color: Colors.grey[800]),
                        hintText: "Enter your Email Address",
                        fillColor: Colors.grey[200]),
                  ),
2
likes
100
pub points
58%
popularity

Publisher

unverified uploader

a flutter package for validation

Repository (GitHub)

Documentation

API reference

License

Icon for licenses.BSD-3-Clause (LICENSE)

Dependencies

flutter

More

Packages that depend on flutter_textfield_validation