myanmar_nrc

Pure Dart utilities for Myanmar National Registration Card (NRC) data lookup, parsing, validation, formatting, and localization.

The package is designed to work in Dart, Flutter, backend, and CLI projects without a Flutter dependency.

Features

  • 426 canonical NRC township-code records from the included dataset.
  • English and Myanmar digit support.
  • English and Myanmar township-code support.
  • NRC type parsing for common NRC markers such as N and နိုင်.
  • Structured validation errors.
  • Search and lookup helpers for states, townships, codes, and names.
  • Formatting to English or Myanmar output.

Usage

import 'package:myanmar_nrc/myanmar_nrc.dart';

void main() {
  final result = MyanmarNrc.parse('12/LAMANA(N)123456');

  if (result.isValid) {
    final nrc = result.value!;
    print(nrc.format(locale: NrcLocale.en)); // 12/LAMANA(N)123456
    print(nrc.format(locale: NrcLocale.my)); // ၁၂/လမန(နိုင်)၁၂၃၄၅၆
  } else {
    print(result.issues);
  }

  final townships = MyanmarNrc.searchTownships('Hlaing', stateCode: 12);
  print(townships.first.townshipName(NrcLocale.my)); // လှိုင်
}

Dataset

Generated package data comes from data/nrc.json, derived from the public dataset at:

https://github.com/chuuhtetnaing/myanmar-nrc-format-dataset

See NOTICE.md for attribution details.

Libraries

myanmar_nrc
Pure Dart utilities for Myanmar NRC lookup, parsing, validation, and formatting.