india_pincode_finder 1.0.0
india_pincode_finder: ^1.0.0 copied to clipboard
Find detailed Indian address information (state, district, taluka) from a 6-digit PIN code. Offline, no API calls. Ideal for logistics, KYC, e-commerce, and mapping.
🇮🇳 india_pincode_finder #

Find detailed Indian address information (state, district, taluka/block) from a valid 6-digit PIN code — fully offline, no API calls. Ideal for logistics, address validation, fintech onboarding (KYC), e-commerce, and mapping.
Install #
dependencies:
india_pincode_finder: ^1.0.0
Usage #
Call init() once (e.g. in main), then look up synchronously anywhere:
import 'package:india_pincode_finder/india_pincode_finder.dart';
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
await IndiaPincodeFinder.init();
final address = IndiaPincodeFinder.pinToAddress(411001);
// PincodeData(pincode: 411001, district: Pune, block: Pune City, state: Maharashtra)
IndiaPincodeFinder.pinToState(411001); // 'Maharashtra'
IndiaPincodeFinder.pinToDistrict(411001); // 'Pune'
IndiaPincodeFinder.pinToTaluka(411001); // 'Pune City'
IndiaPincodeFinder.pinToAddress(999999); // null (not found)
}
API #
| Member | Returns |
|---|---|
Future<void> init() |
Loads & caches the dataset once. Idempotent. |
bool get isInitialized |
Whether data is loaded. |
PincodeData? pinToAddress(int pincode) |
Full record, or null. |
String? pinToState(int pincode) |
State, or null. |
String? pinToDistrict(int pincode) |
District, or null. |
String? pinToTaluka(int pincode) |
Taluka/block, or null. |
void clearCache() |
Clears the cache. |
Calling a lookup before init() throws a StateError. Invalid or unknown PIN
codes return null.
Notes #
- ~1,068 records have a block value of
"NA"in the source data; these are returned verbatim. - Dataset is for educational use, sourced from public databases.
Credits #
This is the Flutter/Dart port of the IndiaPincodeFinder project, which also provides Python (PyPI) and Node.js (npm) packages.
The PIN code dataset and original implementation are by @IntegerAlex (Akshat Kotpalliwar) and @Aniket-Dhumal (Aniket Dhumal), released under GPL-3.0. This port preserves that license and attribution.
License #
GPL-3.0-only. For commercial use without GPL compliance, contact the original authors. See the LICENSE file for details.
