搜索插件、代码仓与 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

所属分类

源码仓库

使用此插件的项目

暂无相关数据。