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

country_list_pick 封面
套件詳情v1.0.1+6

country_list_pick

Flutter 插件專案,用於選擇國家代碼,將顯示國家代碼、撥號代碼、國家旗幟和國家名稱。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
24
喜歡數
135
Pub 分數
130

安裝套件

flutter pub add country_list_pick

套件介紹

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

一個 Flutter 插件,讓使用者能從完整的清單中選擇國家,顯示該國家的國旗、名稱、國家代碼和撥號代碼。專為無縫整合至需要國際電話號碼輸入或位置選擇的表單中而設計,支援 Android、iOS、Web、macOS、Windows 和 Linux 多個平台。此套件透過直覺的介面簡化國家選擇,並提供全球應用所需的必要資料。

適用情境

  • 國際電話號碼輸入
  • 用戶位置選擇
  • 全局表單字段
  • 多語言應用程式本地化
  • 旅行或郵寄地址表單

主要特色

  • 顯示國家旗幟
  • 顯示國家名稱和代碼
  • 包含國碼
  • 支援多個平台
  • 與文字欄位的輕鬆整合

適合對象

  • 需要選擇國家的應用
  • 電話號碼輸入表單
  • 全球用戶入門
  • 旅行和物流應用
  • 跨國電子商務平台

使用建議

  • 需要互聯網以完整載入旗幟(若使用遠端圖片)
  • 由於標誌資產可能增加應用程式大小
  • UI 的自定選項有限
  • 未針對非常大的國家列表進行優化
  • 依賴外部來源取得國家資料

原始 README

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

country list pick

Flutter plugin to pick country with output name, code, dialcode and flag of country

Usage

To use this plugin, add country_list_pick as a dependency in your pubspec.yaml.

    CountryListPick(
        appBar: AppBar(
          backgroundColor: Colors.blue,
          title: Text('Choisir un pays'),
        ),
        
        // if you need custome picker use this
        // pickerBuilder: (context, CountryCode countryCode){
        //   return Row(
        //     children: [
        //       Image.asset(
        //         countryCode.flagUri,
        //         package: 'country_list_pick',
        //       ),
        //       Text(countryCode.code),
        //       Text(countryCode.dialCode),
        //     ],
        //   );
        // },

        // To disable option set to false
        theme: CountryTheme(
          isShowFlag: true,
          isShowTitle: true,
          isShowCode: true,
          isDownIcon: true,
          showEnglishName: true,
        ),
        // Set default value
        initialSelection: '+62',
        // or
        // initialSelection: 'US'
        onChanged: (CountryCode code) {
          print(code.name);
          print(code.code);
          print(code.dialCode);
          print(code.flagUri);
        },
        // Whether to allow the widget to set a custom UI overlay
        useUiOverlay: true,
        // Whether the country list should be wrapped in a SafeArea
        useSafeArea: false
        ),

To call feedback or getting data from this widget, you can make function in onChanged

Special Thanks
  • Salvatore Giordano, CountryCodePicker CountryCodePicker
  • @tomrozb and @dev-fema for changelog 1.0.0+3
  • @giaotuancse for changelog 1.0.0+4
  • @joshuachinemezu for changelog 1.0.0+6 - 1.0.0+8
  • @u-gin for chaangelog 1.0.0+9
  • @imurnane for chaangelog 1.0.1+1
  • @jpainam for chaangelog 1.0.1+2
  • @d00rman for chaangelog 1.0.1+3
  • @MohammadKashaniJabbari for chaangelog 1.0.1+4

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。