Giter Club home page Giter Club logo

dart-countries-states's Introduction

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"
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.