FLUTTER ECOSYSTEM

paulpascal/country_state_city

paulpascal/country_state_city open-source repository details.

国家_省_市 项目封面
Stars
7
Forks
18
最近推送(UTC)
2024年8月11日
项目状态
未归档
paulpascal GitHub avatar
GITHUB User

paulpascal ↗

#SoftwareEngineer. I love solving problem, agressive to learning, creating and sharing... #developer #tech #opensource #datascience, #health, #ml

@medic Lomé, Togo官方网站 ↗
语言DartSwiftKotlinObjective-C

此仓库发布的插件

使用的依赖

依赖清单 3 项
  • flutter{"sdk":"flutter"}
  • flutter_test开发依赖{"sdk":"flutter"}
  • flutter_lints开发依赖^2.0.0

原始 README

以下为英文项目原文快照,最新内容请访问 GitHub。

展开 / 收起项目 README

country_state_city

version version

A flutter package to display list of world wide Countries, States and Cities. It also allows to get a list of States and Cities depends on given country (by ISO CODE).

How to Use

To use this Package, add country_state_city as a dependency in your pubspec.yaml.

// import country_state_city package
import 'package:country_state_city/country_state_city.dart';
// Get all countries
final countries = await getAllCountries();

// Get all states that belongs to a country by country ISO CODE
final states = await getStatesOfCountry('AF'); // Afghanistan

APIs

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

Classes

Class Description
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)
City Handle city data such as: (name, countryCode, stateCode, latitude, longitude)
Timezone Handle timezone data such as: (name, gmtOffset, gmtOffsetName, abbreviation, tzName)
Special Thanks to