BharatValidator class
🇮🇳 BharatValidator — Ultimate India-specific Flutter form validation.
Provides 33+ validators for Indian identity, tax, banking, contact, health, address, and digital fields. Supports English, Hindi & Gujarati error messages out of the box.
Basic Usage
final v = BharatValidator(); // English (default)
final v = BharatValidator(locale: BharatLocale.hindi); // Hindi
final v = BharatValidator(locale: BharatLocale.gujarati); // Gujarati
TextFormField(validator: v.aadhaar)
TextFormField(validator: v.pan)
TextFormField(validator: (val) => v.dob(val, minAge: 18))
TextFormField(validator: (val) => v.amount(val, min: 1, max: 100000))
TextFormField(validator: (val) => v.otp(val, length: 6))
Constructors
- BharatValidator({BharatLocale locale = BharatLocale.english})
- Creates a BharatValidator instance.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
aadhaar(
String? v, {bool deep = false}) → String? - Validates a 12-digit Indian Aadhaar number.
-
abha(
String? v) → String? - Validates an ABHA (Ayushman Bharat Health Account) number or address.
-
amount(
String? v, {double? min, double? max}) → String? - Validates an Indian currency amount with optional min/max range.
-
bankAccount(
String? v) → String? - Validates an Indian bank account number.
-
cardNumber(
String? v) → String? - Validates a credit or debit card number using the Luhn algorithm.
-
cin(
String? v) → String? - Validates an Indian CIN (Company Identification Number).
-
dob(
String? v, {int? minAge, int? maxAge}) → String? - Validates a date of birth with optional minimum and maximum age.
-
drivingLicense(
String? v) → String? - Validates an Indian driving license number.
-
email(
String? v) → String? - Validates an email address.
-
epf(
String? v) → String? - Validates an Indian EPF / PF account number.
-
fssai(
String? v) → String? - Validates an FSSAI food license number.
-
gst(
String? v) → String? - Validates an Indian GST number with state code and checksum verification.
-
ifsc(
String? v) → String? - Validates an Indian bank IFSC code.
-
landline(
String? v) → String? - Validates an Indian landline number with STD code.
-
micr(
String? v) → String? - Validates a 9-digit bank MICR code.
-
name(
String? v) → String? - Validates a person's full name.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
otp(
String? v, {int length = 6}) → String? -
Validates a numeric OTP of given
length(default: 6). -
pan(
String? v) → String? - Validates an Indian PAN card number.
-
passport(
String? v) → String? - Validates an Indian passport number.
-
password(
String? v) → String? - Validates a strong password.
-
phone(
String? v) → String? - Validates a 10-digit Indian mobile number.
-
pincode(
String? v) → String? - Validates a 6-digit Indian PIN code.
-
rationCard(
String? v) → String? - Validates an Indian ration card number.
-
rera(
String? v) → String? - Validates a RERA (Real Estate Regulatory Authority) registration number.
-
swift(
String? v) → String? - Validates an international SWIFT / BIC code.
-
tan(
String? v) → String? - Validates an Indian TAN (Tax Deduction Account Number).
-
tollFree(
String? v) → String? - Validates an Indian toll-free number.
-
toString(
) → String -
A string representation of this object.
inherited
-
udyam(
String? v) → String? - Validates an Udyam / MSME registration number.
-
upi(
String? v) → String? - Validates an Indian UPI ID.
-
url(
String? v) → String? - Validates a website URL.
-
username(
String? v) → String? - Validates a username.
-
vehicle(
String? v) → String? - Validates an Indian vehicle registration number.
-
voterId(
String? v) → String? - Validates an Indian Voter ID / EPIC number.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited