Last updated:
0 purchases
flutter textfield validation
Fancy Containers #
flutter textfield validation lets you validate different textform fields in your Flutter app.
Installation #
Add the latest version of package to your pubspec.yaml (and rundart pub get):
dependencies:
flutter_textfield_validation: ^0.0.1
copied to clipboard
Import the package and use it in your Flutter App.
import 'package:flutter_textfield_validation/flutter_textfield_validation.dart';
copied to clipboard
Example #
There are a number of properties that you can modify:
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]),
),
copied to clipboard
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.