패키지, 저장소 및 앱 카테고리 검색

패키지 상세v0.1.6

country_state_city

지정된 국가에 따라 국가, 주, 도시 목록을 표시하는 플러터 패키지

AndroidiOSWebmacOSWindowsLinux
30일 다운로드
1.6만
좋아요
41
Pub 점수
160

패키지 설치

flutter pub add country_state_city

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

선택한 국가에 따라 국가, 주, 도시 목록을 표시하는 간단한 방법을 제공하는 플러터 패키지입니다. 동적으로 주 및 도시 드롭다운을 채울 수 있어 위치 기반 데이터 입력이 필요한 양식에 적합합니다. 안드로이드, iOS, 웹, 맥OS, 윈도우, 리눅스 등 여러 플랫폼을 지원하여 크로스플랫폼 일관성을 보장합니다. 가볍고 최소한의 설정으로 쉽게 통합할 수 있습니다.

사용 사례

  • 위치 선택이 필요한 폼 입력
  • 동적 상태 및 도시 드롭다운
  • 위치 필드를 포함한 사용자 등록
  • 전자상거래 배송 주소 수집
  • 다국어 위치 지원

주요 기능

  • 국가에 따라 상태 및 도시를 자동으로 채웁니다
  • 모든 주요 플랫폼을 지원합니다
  • 경량이며 통합이 쉬움
  • 전역 위치용 사전 로드 데이터
  • 최소 구성으로 간단한 API

적합한 대상

  • 국제 앱을 개발하는 개발자
  • 동적 위치 선택이 필요한 앱
  • 국가-주-도시 계층을 가진 양식
  • 위치 데이터가 필요한 크로스 플랫폼 애플리케이션

고려 사항

  • 초기 데이터 로드를 위해 인터넷 연결이 필요합니다(포함되지 않은 경우)
  • UI 컴포넌트의 사용자 지정 제한
  • 데이터 세트 크기는 초기 로드 시간에 영향을 줄 수 있습니다
  • 내장된 로컬라이제이션 지원 없음
  • 정확성을 위해 외부 데이터 소스에 의존합니다

원본 README

연결된 소스 저장소의 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

카테고리

소스 저장소

이 패키지를 사용하는 프로젝트

아직 데이터가 없습니다.