dart_countries_states 0.0.8

Dart native js
Flutter Android iOS web

A Dart project that contains all the countries information about them. Support multiple languages.

dart_countries_states #

A Dart project that contains all the countries and states. The content is based on apilayer/restcountries repository.

Getting Started #

The format of the models can be found here

Utility functions #


Country getCountryByName(String name, ...)
Country getCountryByCode2(String code2, ...)
Country getCountryByCode3(String code3, ...)
Country getCountryByCapital(String capital, ...)

List<Country> getCountriesByCapital(String capital, ...)
List<Country> getCountriesByRegion(String region, ...)
List<Country> getCountriesBySubregion(String subregion, ...)

Full list of available functions can be found here

Internationalization #

The supported languages are ['de', 'es', 'fr', 'ja', 'it', 'br', 'pt', 'nl', 'hr', 'fa'].

getCountryByName(name: 'Koweït', lang: 'fr')

Example #

The examples can be found in example and test.

{
  "name": "Bahrain",
  "topLevelDomain": [
    ".bh"
  ],
  "alpha2Code": "BH",
  "alpha3Code": "BHR",
  "callingCodes": [
    "973"
  ],
  "capital": "Manama",
  "altSpellings": [
    "BH",
    "Kingdom of Bahrain",
    "Mamlakat al-Baḥrayn"
  ],
  "region": "Asia",
  "subregion": "Western Asia",
  "population": 1404900,
  "latlng": [
    26,
    50.55
  ],
  "demonym": "Bahraini",
  "area": 765,
  "gini": null,
  "timezones": [
    "UTC+03:00"
  ],
  "borders": [],
  "nativeName": "‏البحرين",
  "numericCode": "048",
  "currencies": [
    {
      "code": "BHD",
      "name": "Bahraini dinar",
      "symbol": ".د.ب"
    }
  ],
  "languages": [
    {
      "iso639_1": "ar",
      "iso639_2": "ara",
      "name": "Arabic",
      "nativeName": "العربية"
    }
  ],
  "translations": {
    "de": "Bahrain",
    "es": "Bahrein",
    "fr": "Bahreïn",
    "ja": "バーレーン",
    "it": "Bahrein",
    "br": "Bahrein",
    "pt": "Barém",
    "nl": "Bahrein",
    "hr": "Bahrein",
    "fa": "بحرین"
  },
  "flag": "https://restcountries.eu/data/bhr.svg",
  "regionalBlocs": [
    {
      "acronym": "AL",
      "name": "Arab League",
      "otherAcronyms": [],
      "otherNames": [
        "جامعة الدول العربية",
        "Jāmiʻat ad-Duwal al-ʻArabīyah",
        "League of Arab States"
      ]
    }
  ],
  "cioc": "BRN"
}
2
likes
90
pub points
57%
popularity

A Dart project that contains all the countries information about them. Support multiple languages.

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

jffiorillo@gmail.com

License

Apache 2.0 (LICENSE)

Dependencies

built_collection, built_value, http, test

More

Packages that depend on dart_countries_states