india_bfsi_lookup 1.0.2
india_bfsi_lookup: ^1.0.2 copied to clipboard
Offline Indian PIN code and IFSC lookup backed by bundled SQLite snapshots.
india_bfsi_lookup #
Library code is released under the MIT License. Bundled PIN and IFSC datasets
have separate upstream terms and attribution requirements; see
DATA-LICENSE.md and NOTICE.
Offline Indian PIN-code and IFSC lookup for Flutter. The package bundles the project's versioned SQLite snapshot and does not make network requests. The default asset contains only the 19,100 canonical PIN locations, keeping the package small; the 154,789 post-office rows are optional.
final lookup = PincodeLookup();
final result = await lookup.lookup('400001');
if (result != null) {
print('${result.city}, ${result.district}, ${result.state}');
}
await lookup.close();
API behavior #
| Method | Input | Invalid input | Unknown input |
|---|---|---|---|
lookup(pin) |
Exactly six digits | InvalidPincodeException |
null |
lookupIfsc(ifsc) |
Standard 11-character IFSC | InvalidIfscException |
null |
Both methods are asynchronous and read only from local SQLite files. The
database files are copied into the app's database directory on first use and
then reused. Call close() when the lookup object is no longer needed.
IfscBranch includes bank, branch, address, city, district, state, MICR and
nullable NEFT/RTGS/IMPS/UPI availability flags.
Platform support #
This package targets Flutter Android and iOS applications through sqflite.
It is intended for mobile and desktop SQLite usage; Flutter Web requires a
different SQLite implementation and is not supported by the bundled database
adapter.
Data and refreshes #
The PIN snapshot is based on the project's validated India PIN master. The IFSC snapshot is a normalized, versioned directory with source metadata kept in the service repository. Refresh the assets from the repository root with the build script, then run the package tests before publishing a new version.
The package is an offline data lookup utility, not a bank or government verification service. Consumers should apply their own freshness and compliance policies for onboarding and payment decisions.
IFSC lookup is available from the same object. The complete IFSC SQLite snapshot is gzip-compressed in the package and transparently extracted to the app database directory on first IFSC lookup:
final branch = await lookup.lookupIfsc('utib0002903');
print(branch?.bankName); // Axis Bank
print(branch?.branchName); // Gurudronacharya
IFSC input is trimmed and normalized to uppercase. Invalid-format values throw
InvalidIfscException; valid but unknown codes return null.
lookup trims surrounding whitespace, throws InvalidPincodeException for
anything other than six digits, and returns null for a valid but unknown PIN.
The bundled data is derived from the service snapshot in data/ and should be
refreshed when that snapshot is regenerated.
Snapshot size options #
From the repository root, build the default location-only asset with:
bash flutter/india_bfsi_lookup/tool/build_snapshot.sh
To bundle the complete post-office table instead, run this before building or publishing the package:
bash flutter/india_bfsi_lookup/tool/build_snapshot.sh --include-post-offices
The second command replaces assets/pincode.sqlite with the larger variant;
the package API and asset name remain unchanged.