indian_formatters 0.0.2
indian_formatters: ^0.0.2 copied to clipboard
A comprehensive Flutter/Dart package for India-specific number formatting, currency, validators (PAN, Aadhaar, GST, IFSC, UPI), date utilities, and address tools. All-in-one — one import, everything included.
Changelog #
0.0.2 #
🎉 Major Release: Enhanced Validation, Tree-Shaking, and Parsing #
Released: April 24, 2026
✨ New Features
1. Pincode Mapper 📍
- Lightweight utility for accurate PIN code to state/region mapping using official India Post allocation logic
- Maps 70+ postal regions using first 2 digits
- Accurate state detection (e.g., 41xxxx → Pune Region, Maharashtra)
- Union Territory identification
- Search and filter capabilities
- Lightweight (~5KB) - no massive database required
2. Tree-Shaking Support 🌳
- Granular import options for optimal bundle size
- Import only validators: ~40% smaller bundle
- Import only formatters: ~35% smaller bundle
- Import individual validators: ~70-80% smaller bundle
3. Deep Checksum Validation 🔐
- Mathematical checksum verification for PAN and GST numbers
- PAN: Implements weighted sum algorithm for 10th character
- GST: Implements modulo-36 algorithm for 15th character
- Optional verification (defaults to enabled)
- Utility methods to calculate checksums
4. Reverse Parsing 🔄
- Robust utilities to parse formatted Indian number strings back to numbers
- Supports Indian comma grouping, currency symbols, compact notation
- Negative numbers and ranges support
- Round-trip format/parse validation
🔧 Improvements
- Enhanced validation with mathematical checksums
- 258 total tests (up from 47 in v0.0.1)
- 100% backward compatible - no breaking changes
- Enhanced API with new utility methods
- Better error handling and validation feedback
📦 Package Size Optimization
- Tree-shaking support reduces bundle size by up to 80%
- Granular imports for optimal performance
0.0.1 #
- Initial release
- Number formatting (Indian system with lakhs and crores, words in English and Hindi, compact notation)
- Currency formatting (₹ symbol, cheque format, words, compact notation)
- Validators: PAN, Aadhaar (with Verhoeff algorithm), GST, Mobile, IFSC, Pincode, Driving License, Voter ID, UPI
- Date formatting (Indian format, Hindi numerals, fiscal year, financial quarter, Hindu month names)
- Address utilities (all 28 states + 8 UTs with GST codes, capitals, Hindi names)
- Full extension support on
numandDateTimetypes - Zero external dependencies (except
metafor annotations) - Support for all platforms: Android, iOS, Web, macOS, Windows, Linux