搜尋套件、儲存庫與 APP 分類

套件詳情v1.3.1

us_states

一個簡單的 Dart 庫,用於處理州名和縮寫。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
2.9萬
喜歡數
12
Pub 分數
160

安裝套件

flutter pub add us_states

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

一個簡單的 Dart 庫,用於處理美國州名及其縮寫。它提供對州資料的便捷存取,包括完整名稱、兩位字母縮寫及其他常見對應。非常適合需要基於州的查詢、表單驗證或地址處理的應用程式。此套件輕量且支援所有主要平台:Android、iOS、Web、macOS、Windows 與 Linux。由 webb.engineer 維護,並託管於 GitHub,以確保透明度與社群貢獻。

適用情境

  • 地址表單驗證
  • 國家下拉選單產生
  • 地理數據映射
  • 用戶位置選擇
  • 美國各州的資料歸一化

主要特色

  • 完整州名轉縮寫查詢
  • 縮寫到全名的轉換
  • 支援所有50個美國州
  • 跨平台相容性
  • 輕量且易於整合

適合對象

  • 表單處理應用
  • 基於位置的服務
  • 資料輸入工具
  • 地理資訊系統
  • 需要狀態資料的Dart專案

使用建議

  • 僅限美國各州
  • 不支援地區或縣
  • 需要手動更新以應對新的狀態變更
  • 不適用於國際國家資料

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

us_states

Simple Dart library to deal with state names and abbreviations.

CircleCI

Installation

Add the following to dependencies section in your pubspec.yml:

  us_states: ^1.3.1

Usage

Note
  • All methods that take a string are case-insensitive. No need to adjust case before passing string into a method.
Get a state's name from an abbreviation

Returns null if not found.

USStates.getName("IA");
// returns "Iowa"
Get a state's abbreviation from name

Returns null if not found.

USStates.getAbbreviation("Iowa");
// returns "IA"
Get a list of all state names
USStates.getAllNames();
// returns ["Alaska", "Alabama", ...]
Get a list of all state abbreviations
USStates.getAllAbbreviations();
// returns ["AK", "AL", ...]
Get a map with state abbreviations as keys and names as values
USStates.getAbbreviationMap();
// returns {"AK": "Alaska", "AL": "Alabama", ...}
Get a map with state names as keys and abbreviations as values
USStates.getNameMap();
// returns {"Alaska": "AK", "Alabama": "AL", ...}

所屬分類

依賴

依賴清單 1 項

原始碼儲存庫

使用此套件的專案

暫無相關資料。

所在榜單