country_state_city library

This library provides functions and models to help you fetch world countries states, cities. You can get all the states that belongs to a country, as well as all cities

Classes

City
Handle city data such as: (name, countryCode, stateCode, latitude, longitude)
Country
Handle country data such as: (name, isoCode, phoneCode, flag, currency, latitude, longitude, timezones)
State
Handle state data such as: (name, countryCode, isoCode, latitude, longitude)
Timezone
Handle timezone data such as: (name, gmtOffset, gmtOffsetName, abbreviation, tzName)

Functions

getAllCities() Future<List<City>>
Get world wide cities list.
getAllCountries() Future<List<Country>>
Get world wide countries list.
getAllStates() Future<List<State>>
Get world wide states list.
getCountryCities(String countryCode) Future<List<City>>
Get the list of cities that belongs to a country by the country ISO CODE
getCountryFromCode(String countryCode) Future<Country?>
Get country from its ISO CODE
getStateByCode(String countryCode, String stateCode) Future<State?>
Get a state from its code and its belonging country code
getStateCities(String countryCode, String stateCode) Future<List<City>>
Get the list of states that belongs to a state by the state ISO CODE and the country ISO CODE
getStatesOfCountry(String countryCode) Future<List<State>>
Get the list of states that belongs to a country by the country ISO CODE