jp_prefecture 2.0.0 copy "jp_prefecture: ^2.0.0" to clipboard
jp_prefecture: ^2.0.0 copied to clipboard

A library that converts Japanese prefecture codes and prefecture names.

jp_prefecture #

A library that converts Japanese prefecture codes and prefecture names.

Usage #

Find a Japanese prefecture by prefecture code. #

final pref = JpPrefecture.findByCode(13);
if (pref == null) {
  return;
}
print(pref.code); // => 13
print(pref.name); // => '東京都'
print(pref.nameE); // => 'Tokyo'
print(pref.nameH); // => 'とうきょうと'
print(pref.nameK); // => 'トウキョウト'
print(pref.area); // => '関東'
print(pref.type); // => '都'

Find a Japanese prefecture by prefecture name. #

final pref = JpPrefecture.findByName('東京都');
if (pref == null) {
  return;
}
print(pref.code); // => 13
print(pref.name); // => '東京都'
print(pref.nameE); // => 'Tokyo'
print(pref.nameH); // => 'とうきょうと'
print(pref.nameK); // => 'トウキョウト'
print(pref.area); // => '関東'
print(pref.type); // => '都'

Get all Japanese prefectures. #

final prefs = JpPrefecture.all;
print(prefs.first.code); // => 1
print(prefs.first.name); // => '北海道'
print(prefs.first.nameE); // => 'Hokkaido'
print(prefs.first.nameH); // => 'ほっかいどう'
print(prefs.first.nameK); // => 'ホッカイドウ'
print(prefs.first.area); // => '北海道'
print(prefs.first.type); // => '道'
4
likes
130
pub points
58%
popularity

Publisher

unverified uploader

A library that converts Japanese prefecture codes and prefecture names.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on jp_prefecture