CountryCodePickerPlus 是一个 Flutter 包,旨在简化电话号码的收集,并实现准确的国家代码选择。它提供了一个直观且可定制的选取界面,支持 Android、iOS、Web、macOS、Windows 和 Linux 等多个平台。该包通过提供可搜索的国家列表、自动显示国旗以及无缝集成到表单中,提升了用户体验。它通过处理国家代码的格式化和验证,简化了国际号码输入。
适合场景
国际电话号码输入
用户注册带国家代码
多区域表单支持
电信应用功能
联系表单增强功能
主要特点
可搜索的国家列表
国家旗帜图标
自动国家代码检测
可自定义的 UI
跨平台兼容性
与文本字段的轻松集成
适合对象
全局应用
用户引导流程
消息或通话应用
电商平台
出行或物流服务
使用建议
需要互联网以获取完整的国家数据
可能需要针对特定地区的偏好进行定制
仅限国家代码功能(无完整电话号码验证)
未针对非常大的国家列表进行优化
依赖外部数据源获取国家元数据
原始 README
以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。
country_code_picker_plus
A Flutter package that provides an easy-to-use widget for picking country codes. This widget
supports various customization options including displaying country flags, searching countries, and
presenting the picker in different modes such as dialog, dropdown, and bottom sheet.
Description
country_code_picker_plus is a Flutter package designed to simplify the process of selecting
country codes in your mobile application. This package provides extensive customization options,
allowing developers to tailor the picker to their specific needs. Whether you want to show country
flags, search for countries, or present the picker in different styles, country_code_picker_plus
has you covered.
Sample Code
Here is a basic example demonstrating how to use the country_code_picker_plus package with various
customization options:
This widget allows users to enter a phone number with a country code. It validates the phone number
according to the country code and formats the phone number.
Features
Validate Phone Number: Validates the phone number according to the country code.
Format Phone Number: Automatically formats the phone number.
This section describes the PhoneInputField widget with its features and provides a sample code
snippet on how to use it.
📱 Supported Platforms
Mobile Application
Desktop Application
Web Application
Contributions
Contributions of any kind are more than welcome! Feel free to fork and improve
country_code_picker_plus
in any way you want, make a pull request, or open an issue.
This project follows the all-contributors specification. Contributions of any kind welcome!
Getting Involved
First of all, thank you for considering to get involved. You are a real superstar ⭐ and we ❤️ you!
Reporting Bugs and Issues
Use the configured Github issue report template when reporting an issue. Make sure to clearly state your observations and expectations so we can understand your needs and troubleshoot effectively.
Discussions and Ideas
We're happy to discuss and talk about ideas. Post your questions on StackOverflow.