country_state_city 0.1.5 country_state_city: ^0.1.5 copied to clipboard
A flutter package to display list of Countries, States and Cities depends on a given country
// ignore_for_file: unused_local_variable
import 'package:country_state_city/country_state_city.dart';
void main() async {
// Get all countries
final countries = await getAllCountries();
// Get all states
final states = await getAllStates();
// Get all cities
final cities = await getAllCities();
// Get a country
final country = await getCountryFromCode('AF');
if (country != null) {
final countryStates = await getStatesOfCountry(country.isoCode);
final countryCitis = await getCountryCities(country.isoCode);
}
}