0 purchases
dart countries states
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, ...)
copied to clipboard
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')
copied to clipboard
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"
}
copied to clipboard
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.