パッケージ、リポジトリ、アプリカテゴリを検索

パッケージ詳細v0.1.6

country_state_city

指定された国に応じて国、州、都市のリストを表示するFlutterパッケージ

AndroidiOSWebmacOSWindowsLinux
30日間ダウンロード
1.6万
いいね数
41
Pub ポイント
160

パッケージをインストール

flutter pub add country_state_city

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

選択した国に基づいて国、州、都市のリストを表示するための簡単な方法を提供するFlutterパッケージです。州と都市のドロップダウンを動的に埋めることができ、場所ベースのデータ入力が必要なフォームに最適です。Android、iOS、Web、macOS、Windows、Linuxなど複数のプラットフォームをサポートしており、クロスプラットフォームでの一貫性を確保します。軽量で、最小限のセットアップで簡単に統合できます。

用途

  • 場所選択が必要なフォーム入力
  • 動的ステートと都市のドロップダウン
  • 場所フィールドを含むユーザー登録
  • EC配送先住所収集
  • マルチ言語ロケーションサポート

主な機能

  • 国に基づいて州と都市を自動入力します
  • すべての主要プラットフォームをサポートしています
  • 軽量で統合が簡単
  • グローバルな場所のプレロードデータ
  • 最小限の構成でシンプルな 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

カテゴリー

ソースリポジトリ

このパッケージを使用しているプロジェクト

データはまだありません。