bharat_fx 1.0.6
bharat_fx: ^1.0.6 copied to clipboard
The ultimate Indian localization and input toolkit for Flutter, featuring currency formatters, PIN code lookup, vernacular keyboards, and ID validators.
Changelog #
1.0.6 #
- โก Performance & Memory Footprint Optimizations:
- Zero-Allocation Verhoeff Algorithm (
Aadhaar&VID): Rewrote Verhoeff check-digit validation and generation using direct ASCII byte indexing (codeUnitAt), eliminating intermediate string splitting, array reversal, and list allocation overhead. - Zero-Allocation Luhn Algorithm (
BharatCard): Optimized card checksum calculation with in-place ASCII byte arithmetic, removing temporary substring allocations and repeated integer parsing. - Precompiled Static Regular Expressions: Migrated inline
RegExpinstantiations across all validators, formatters, and PII redactors (Aadhaar,PAN,VID,Card,PIN Code,GSTIN,IFSC,Vehicle,Driving License,Voter ID,Passport,CIN,TAN,DIN,Phone,UPI,PII Redactor,GST Invoice,Number to Words) to precompiled static patterns, eliminating regex recompilation on every keystroke and validation cycle. - Const Constructors for Formatters: Added
constconstructors to all 16TextInputFormattersubclasses and converted formatter lists toconstinBharatTextField, significantly reducing heap allocations during widget rebuilds. - Memoized PIN Code Resolution (
BharatPinCodeFormField): Prevented redundant lookup calls and unnecessarysetStatecycles when cursor position changes or text is tapped without content modification. - Fast-Path Vernacular & Money Parsing: Added fast non-allocating checks in vernacular script formatters and replaced regex matching in
BharatMoney.parsewith character inspections.
- Zero-Allocation Verhoeff Algorithm (
- ๐ก๏ธ 100% Backward Compatible & Dependency-Free:
- Zero changes to existing public APIs or method signatures.
- Maintained 100% pure Dart & Flutter dependency-free guarantee (zero external third-party runtime dependencies).
1.0.5 #
- ๐ Indian GST Invoice Helpers, HSN/SAC & e-Invoice QR (
BharatHsn,BharatSac,BharatGstInvoice,BharatGstQr):- HSN & SAC Code Validation (
BharatHsn,BharatSac):- Validates 2, 4, 6, and 8-digit HSN codes for goods with offline lookup of all 98 standard chapters (01โ98).
- Validates 6-digit Services Accounting Codes (SAC) starting with Chapter 99 and resolves major service categories (IT, consulting, construction, transport, etc.).
- Statutory GST turnover compliance checker (
isTurnoverCompliant) based on Central Tax Notification No. 78/2020 (min 4 digits for turnover $\le$ โน5 Cr, min 6 digits for turnover $>$ โน5 Cr, 8 digits for export/import).
- CGST Rule 46(b) Invoice Number Validator (
BharatGstInvoice):- Strictly validates tax invoice serial numbers against statutory Rule 46(b) requirements: max 16 characters, alphanumeric characters restricted strictly to hyphens (
-) and slashes (/). - Prohibited character diagnostic reporter (detects spaces, underscores, dots, and special characters rejected by the GST portal).
- Automatic invoice number sanitizer (
sanitizeInvoiceNumber) and compliant serial generator (buildInvoiceNumber). - Standard GST Document Types (
GstDocumentType):taxInvoice,creditNote,debitNote,billOfSupply,deliveryChallan.
- Strictly validates tax invoice serial numbers against statutory Rule 46(b) requirements: max 16 characters, alphanumeric characters restricted strictly to hyphens (
- Offline B2B e-Invoice QR Code Parser (
BharatGstQr):- Pure Dart, zero-dependency offline parser for Invoice Registration Portal (NIC / IRP) signed e-invoice QR code JWT payloads.
- Extracts supplier & recipient GSTINs, document number, document date, total invoice amount, line item count, main HSN code, and IRN.
- 64-character SHA-256 Invoice Reference Number (IRN) format validator.
- HSN & SAC Code Validation (
1.0.4 #
- ๐ Indian Identity & KYC Expansion (
BharatId):- MoRTH Driving License (
BharatDrivingLicense/BharatDl): Validates 15/16-character MoRTH DLs, auto-hyphenates toSS-RR-YYYY-NNNNNNN, resolves state name, issuing RTO office, and issue year, with privacy masking (DL-01-XXXX-XXX2345). - Voter ID / EPIC (
BharatVoterId/BharatEpic): Validates 10-character Election Commission of India (ECI) Voter IDs, extracts assembly constituency code and serial number, with compliant masking (ABCXXXX567). - Indian Passport (
BharatPassport): Validates Ministry of External Affairs 8-character Indian passport format (series letter + 7 digits, rejecting invalid series like Q), with compliant masking (KXXXXX67). - Corporate & MCA Identification (
BharatCin,BharatTan,BharatDin):- CIN (Corporate Identification Number): 21-character validator extracting listing status (Listed/Unlisted), 5-digit industry code, state, incorporation year, company classification (PTC, PLC, FTC, GOI, etc.), and registration number with privacy masking.
- TAN (Tax Deduction Account Number): 10-character validator with jurisdiction, deductor initial, and check letter extraction.
- DIN (Director Identification Number): 8-digit MCA director number validator and masking.
- MoRTH Driving License (
- ๐งพ Indian Goods & Services Tax Engine (
BharatGst):- Precision integer Paise tax arithmetic using
BharatMoney. - Automatic tax bifurcation: Intra-State (50% CGST + 50% SGST) vs Inter-State (100% IGST).
- Auto-detection of inter-state transactions from GSTINs or 2-digit GST state codes.
- Reverse / Inclusive GST calculation (extract base taxable price and tax components from MRP).
- Complete official 2-digit GST State / UT code directory.
- Precision integer Paise tax arithmetic using
- ๐
Indian Fiscal & Settlement Calendar (
BharatFiscal):- Financial Year (
FY 2024-25) and Assessment Year (AY 2025-26) resolution (April 1 โ March 31 cycle). - Indian Fiscal Quarters (Q1: Apr-Jun, Q2: Jul-Sep, Q3: Oct-Dec, Q4: Jan-Mar).
- Statutory Advance Tax installment schedule (15% by June 15, 45% by Sep 15, 75% by Dec 15, 100% by Mar 15).
- RBI Banking Holiday engine: identifies Sundays, 2nd & 4th Saturdays, and national gazetted holidays (Jan 26, May 1, Aug 15, Oct 2).
- Market settlement date calculator (
T+1andT+2settlement skipping Indian banking holidays and weekends).
- Financial Year (
- ๐ Enhanced Fintech Input Field (
BharatTextField):- Added new input presets:
drivingLicense,voterId,passport,cin,tan, anddin. - Added dedicated text input formatters and automatic credential protection (suppresses cloud keyboard suggestions and autocorrect).
- Added callbacks:
onDrivingLicenseResolvedandonCinResolved.
- Added new input presets:
- ๐ก๏ธ Security & PII Redactor (
BharatPiiRedactor):- Added sensitive key suppression for
driving_license,voter_id,passport,cin,tan, anddinin JSON telemetry scrubbers (DPDP Act 2023 compliant).
- Added sensitive key suppression for
- โจ 100% Backward Compatible:
- Zero breaking changes to existing APIs, signatures, or behavior.
- 100% pure Dart & Flutter with zero external package dependencies.
1.0.3 #
- ๐ก๏ธ Enterprise Fintech Security Module (
BharatSecurity):- Side-Channel Timing Attack Defense (
TimingSafe): Constant-time string, byte, and integer comparisons for OTPs, MPINs, webhook signatures, and tokens. - Sensitive Memory Protection (
SensitiveValue<T>): Zeroizable, leak-proof memory wrapper that suppresses raw values from logs, crash reports, and JSON telemetry (OWASP MASVS-STORAGE / PRIVACY). - Comprehensive PII Redactor (
BharatPiiRedactor): Auto-detects and redacts Aadhaar (UIDAI rules), VIDs, PANs, Luhn-verified cards, CVVs, bank accounts, UPI VPAs, and phones in text and JSON maps (DPDP Act 2023 compliant). - Zero-Dependency Cryptographic Integrity (
BharatHash): Pure-Dart RFC 6234 SHA-256 and RFC 2104 HMAC-SHA256 payload signing and payment checksum verification. - Anti-Brute Force Guard (
AntiBruteForceGuard): Sliding-window rate limiter to throttle credential and OTP guessing attacks. - Fintech Input Security (
FintechInputSecurityConfig): Mobile keylogging and cloud prediction prevention with clipboard guards.
- Side-Channel Timing Attack Defense (
- ๐ฐ Exact Precision Money (
BharatMoney):- Fixed-point integer Paise arithmetic (
1 Rupee = 100 Paise) eliminating IEEE-754 floating-point rounding bugs. - Pre-built NPCI & RBI transaction limit validations (UPI standard โน1L, capital markets โน2L, institutional โน5L; IMPS โน5L).
- Rejection of scientific notation and injection attacks during string parsing.
- Fixed-point integer Paise arithmetic (
- ๐ณ Payment Cards & RBI Tokenization (
BharatCard&BharatCardToken):- NPCI RuPay, Visa, Mastercard, and American Express validation with Luhn (Modulo 10) algorithm.
- PCI DSS 4.0 compliant masking and RBI Card-on-File Tokenization (CoFT) data models.
- Card expiry and CVV validation.
- ๐ฆ Banking & UPI Deep Link Guards:
- 9-to-18 digit Indian Bank Account validation with bank-specific lengths (SBI, HDFC, ICICI, Axis, PNB, etc.) and timing-safe confirmation matching (
BharatBankAccount). - NPCI UPI Intent & Deep Link parser (
BharatUpiIntent) with tampering detection, amount limit verification, and non-INR currency rejection. - Defenses against invisible zero-width spaces, Cyrillic/Greek homoglyph attacks, and phishing handles in UPI VPAs.
- Merged and defunct bank IFSC detection with RBI migration advisories (
BharatIfsc). - UIDAI 16-digit Virtual ID (VID) validation with Verhoeff algorithm and masking (
BharatVid).
- 9-to-18 digit Indian Bank Account validation with bank-specific lengths (SBI, HDFC, ICICI, Axis, PNB, etc.) and timing-safe confirmation matching (
- ๐ Hardened
BharatTextFieldWidget:- Added
BharatTextFieldTypepresets:vid,card,cvv,bankAccount, andmoney. - Support for
obscureText, obscure toggle buttons, clipboard copy/paste protection, and cloud prediction keyboard suppression.
- Added
1.0.2 #
- Shortened package description in
pubspec.yamlto adhere to pub.dev conventions.
1.0.1 #
- Standardized Dart code formatting across all library files.
- Enhanced documentation with visual banner graphic.
- Refined Dart SDK constraints for broad compatibility.
1.0.0 #
- Initial release of
bharat_fx: The Ultimate Indian Localization & Input Toolkit for Flutter. - Module 1: Indian Currency Formatter (
BharatCurrency) - Module 2: Smart Indian Address & PIN Code Validator (
BharatInput) - Module 3: Vernacular Keyboard & Input Filters (
BharatText) - Module 4: Local Vehicle Number Plate Validator (
BharatVehicle) - Module 5: Indian Government IDs & UPI Validators (
BharatId) - Module 6: Batteries-Included UI Widgets