taiwan_zip 0.2.0 copy "taiwan_zip: ^0.2.0" to clipboard
taiwan_zip: ^0.2.0 copied to clipboard

outdated

Map zip code to cities in Taiwan

example/main.dart

import 'package:taiwan_zip/taiwan_zip.dart';

void main() {
  final TaiwanZip taiwanZip = TaiwanZip();
  // `cities` returns all the cities in Taiwan.
  print('Cities in Taiwan: ${taiwanZip.cities}');
  // `zipCodes` returns all the zip codes in Taiwan.
  print('There are ${taiwanZip.zipCodes.length} unique zip codes');

  // Static functions can be used without an instance.
  // `TaiwanZip.toDistrict` finds the district based on the
  // zip code.
  var zipCode = '100';
  print('$zipCode refers to ${TaiwanZip.toDistrict(zipCode)}');
  // `TaiwanZip.toZip` finds the zip code of a district.
  // Since the sole district names may duplicate, city prefix is required.
  var district = '臺北市中正區';
  print('$district uses ${TaiwanZip.toZip(district)} as its zip code');
  // `TaiwanZip.getDistricts` returns all the districts in the city the user
  // provided.
  var city = '臺北市';
  print('Districts in $city include ${TaiwanZip.getDistricts(city)}');
}
1
likes
0
points
107
downloads

Publisher

unverified uploader

Weekly Downloads

Map zip code to cities in Taiwan

Repository (GitHub)
View/report issues

License

unknown (license)

More

Packages that depend on taiwan_zip