bharatvalidator 1.0.2
bharatvalidator: ^1.0.2 copied to clipboard
🇮🇳 India-first Flutter form validation package with 30+ validators. Covers Aadhaar, PAN, GST, IFSC, UPI, Driving License, Passport, Voter ID etc.
Changelog #
All notable changes to BharatValidator will be documented in this file.
1.0.2 — Bug Fixes #
aadhaar — Fixed Verhoeff algorithm edge case for numbers starting with 2 gst — Fixed checksum validation for special category states (97, 99) dob — Fixed curly_braces_in_flow_control_structures lint warning cardNumber — Fixed Luhn algorithm for 13-digit card numbers (older Visa cards)
🔧 Code Quality
Removed unused _inv table from aadhaar_validator.dart (unused_field warning fixed) Replaced final with const in gst_validator.dart (prefer_const_declarations fixed) Added /// dartdoc comments to all 33 public API methods (pub.dev score: 10/10) All warnings from flutter analyze resolved — zero issues
📖 Documentation
Full dartdoc coverage on BharatValidator class and all methods BharatLocale enum values documented (english, hindi, gujarati) Code examples added to every public method pub.dev API score improved from 0/10 → 10/10
🤖 CI/CD
Added GitHub Actions workflow for automated releases (release.yml) Added CI workflow for PR checks with flutter analyze + flutter test (ci.yml) Auto-publish to pub.dev on version tag push (v*..) Release notes auto-populated from CHANGELOG.md
1.0.1 — New Validators #
swift — SWIFT/BIC code for international bank transfers rationCard — Indian ration card number tollFree — Indian toll-free numbers (1800, 1860, 1900)
🔒 Deep Validation (Breaking Improvement)
aadhaar — Now uses Verhoeff checksum algorithm (same as UIDAI) — rejects fake numbers gst — Now validates state code (01–37) + checksum character — rejects invalid GST
💅 Example App Improvements
Search bar — filter validators by name or category instantly Copy button — copy hint value to clipboard on every field Stats bar — shows total validator count and language count Better section headers — colored left border accent Cleaner architecture — _ValidatorItem model, grouped rendering
1.0.0 — Initial Release #
🎉 First stable release of BharatValidator — India-first Flutter form validation package. #
✅ 30+ Validators added
🪪 Identity
aadhaar— 12-digit Aadhaar number (starts 2–9)pan— PAN card (ABCDE1234F format)passport— Indian passport numbervoterId— Voter ID / EPIC numberdrivingLicense— Indian driving license number
🏢 Tax & Business
gst— 15-character GST numbertan— TAN (Tax Deduction Account Number)cin— Company Identification Numberfssai— FSSAI license number (14 digits)udyam— Udyam / MSME registration numberrera— RERA registration number
🏦 Banking & Finance
ifsc— Bank IFSC codeupi— UPI ID (name@handle)bankAccount— Bank account number (9–18 digits)cardNumber— Credit/Debit card with Luhn algorithmmicr— MICR code (9 digits)epf— EPF / PF account numberamount— Indian currency amount with optional min/max
📞 Contact
phone— 10-digit Indian mobile number (+91 supported)email— Email addresslandline— Indian landline number with STD code
🏥 Health
abha— ABHA / Ayushman Bharat Health Account number
📍 Address & Vehicle
pincode— 6-digit Indian pincodevehicle— Indian vehicle registration number (GJ01AB1234)
👤 Personal
name— Full name (supports Devanagari & Gujarati scripts)password— Strong password (8+ chars, upper, lower, digit, symbol)username— Username (3–20 chars, letters/digits/_/-)dob— Date of birth with optional min/max age validation
🌐 Digital
url— Website URL (http/https)otp— OTP validator (4 or 6 digit)
🌐 Multi-language error messages
- English 🇬🇧
- Hindi 🇮🇳
- Gujarati 🟠
📖 Usage
final v = BharatValidator(); // English
final v = BharatValidator(locale: BharatLocale.hindi); // Hindi
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))