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

intl_phone_field 封面
套件詳情v3.2.0

intl_phone_field

一個自定義的 Flutter TextFormField,用於輸入帶國家代碼的國際電話號碼。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
14.1萬
喜歡數
783
Pub 分數
145

安裝套件

flutter pub add intl_phone_field

套件介紹

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

intl_phone_field 是一個 Flutter 套件,提供了一個自訂的 TextFormField,用於輸入國際電話號碼,並支援自動檢測與選擇國家代碼。它整合了國家選擇器,讓使用者可以選擇自己的國家,並自動設定適當的國家代碼。此欄位支援根據國際標準對電話號碼進行驗證與格式化,非常適合需要全球電話號碼輸入的表單。它可在所有主要平台(包括 Android、iOS、Web、macOS、Windows 和 Linux)上運作。

適用情境

  • 國際聯繫表單
  • 用戶註冊並進行手機驗證
  • 全球客戶支援系統
  • 多區域應用註冊
  • 網頁和行動應用中的電話號碼驗證

主要特色

  • 內建國家選擇器
  • 自動國家代碼檢測
  • 即時電話號碼格式化
  • 跨平台相容性
  • 可自訂樣式
  • 驗證支援

適合對象

  • 面向全球受眾的應用
  • 需要電話號碼輸入的表單
  • 需要國家代碼整合的開發者
  • 面向國際用戶的行動與網路應用
  • 需要標準化電話號碼處理的專案

使用建議

  • 需要網路連接以獲得完整功能
  • 可能需要額外的驗證邏輯來處理邊緣情況
  • 自定選項僅限於使用者介面方面
  • 取決於底層國家資料的準確性
  • 大型國家清單可能帶來的效能影響

原始 README

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

International Phone Field Package

pub package CI License: MIT

A customised Flutter TextFormField to input international phone number along with country code.

This widget can be used to make customised text field to take phone number input for any country along with an option to choose country code from a dropdown.

⚠️ The package is deprecated and this repository is no longer maintained ⚠️

As of June 2021, I, @marcaureln, have been maintaining this Flutter package initially created by @vanshg395. Regrettably, Vansh has been unresponsive, and I am unable to release new versions (the last release is 6 months old as of writing).

Considering this, I recommend users to explore alternatives on pub.dev or, if interested, fork this repository for continued support. Life can be hectic, and I wish Vansh is doing well.

Thank you for your understanding and continued support.

Old Readme

Screenshots

Installing

To use this package:

Run this command:

flutter pub add intl_phone_field

Or, add the following to your pubspec.yaml file:

dependencies:
  intl_phone_field: ^<latest_version>

Sometimes you may want to use the latest version of the package, instead of a published version. To do that, use the git syntax:

dependencies:
  intl_phone_field:
    git:
      url: git://github.com/vanshg395/intl_phone_field.git
      ref: master

How to Use

Simply create a IntlPhoneField widget, and pass the required params:

IntlPhoneField(
    decoration: InputDecoration(
        labelText: 'Phone Number',
        border: OutlineInputBorder(
            borderSide: BorderSide(),
        ),
    ),
    initialCountryCode: 'IN',
    onChanged: (phone) {
        print(phone.completeNumber);
    },
)

Use initialCountryCode to set an initial Country Code.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

Comment on Issue or Pull Request, asking @all-contributors to add a contributor:

@all-contributors please add @<username> for <contributions>

<contributions>: See the Emoji Key (Contribution Types Reference) for a list of valid contribution types.

Maintainers

Contributors

Vansh Goel
Vansh Goel

💻
KNO3
KNO3

💻
Ling Li
Ling Li

💻
Anggara Putra Pratama
Anggara Putra Pratama

💻
JJ Geewax
JJ Geewax

💻
Keval Prajapati
Keval Prajapati

💻
Guillaume Launay
Guillaume Launay

💻
hans.huang
hans.huang

💻 📖
Gregor Weber
Gregor Weber

💻
Ooi Han Yi
Ooi Han Yi

💻
Jimmy Forrester-Fellowes
Jimmy Forrester-Fellowes

💻

LICENSE

This project is licensed under the MIT license. See LICENSE for more information.

所屬分類

原始碼儲存庫

使用此套件的專案