パッケージ、リポジトリ、アプリカテゴリを検索

extended_phone_number_input のカバー
パッケージ詳細v1.0.2

extended_phone_number_input

国コード、検証、連絡先ピッカーをサポートする電話入力 Flutter ウィジェット

AndroidiOS
30日間ダウンロード
247
いいね数
36
Pub ポイント
130

パッケージをインストール

flutter pub add extended_phone_number_input

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

国コードの選択、リアルタイム検証、デバイスの連絡先ピッカーとの統合を内蔵した、電話番号入力に対応するFlutterウィジェットです。選択された国に基づいて入力を自動的にフォーマットし、検証することで、国際電話番号の入力を簡素化します。このパッケージは、さまざまな地域で電話番号が必要なフォームにおけるユーザー体験を向上させるために設計されています。

用途

  • 国際電話番号の収集
  • 国ごとのルールを使用したフォーム検証
  • 連絡先ピッカーの統合
  • 動的国コード選択
  • 使いやすい電話入力UI
  • モバイルアプリ登録フロー

主な機能

  • 国コードの自動検出
  • リアルタイム入力検証
  • 連絡先ピッカーの統合
  • カスタマイズ可能なスタイル
  • 複数のロケールをサポート
  • 自動フォーマット

適している対象

  • グローバルアプリケーション
  • ユーザー登録フォーム
  • カスタマーサービスアプリ
  • 国際電話入力が必要なアプリ
  • 堅牢な電話入力処理が必要な開発者

注意事項

  • 完全な国データの取得にはインターネット接続が必要です
  • 連絡先へのアクセスには追加の権限が必要な場合があります
  • 国リストのカスタマイズが限定的
  • フォーマットロジックのための外部依存関係に依存しています
  • 非常に大きなデータセットには最適化されていない
  • 初期設定には構成が必要な場合があります

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

A Highly customizable Phone input Flutter widget that supports country code, validation and contact picker.

Features

  • Phone number with international validation
  • Include only specific countries
  • Exclude specific countries
  • Set a phone number using a controller (Selected country will be updated automatically)
  • Pick a phone number from contacts list

Getting started

Install the package extended_phone_number_input:

flutter pub add extended_phone_number_input

If you target Android 11+ (API 30+) and want to use the build-in contact picker you need to add the android.permission.READ_CONTACTS permission on the AndroidManifest.xml as this permission will be requested automatically.

Usage

A full and rich example can be found in /example folder.

Simple usage
 PhoneNumberInput(initialCountry: 'SA', locale: 'ar')
Show countries as dialog (default is bottom sheet)
 const PhoneNumberInput(
    initialCountry: 'US',
    locale: 'en',
    countryListMode: CountryListMode.dialog,
    contactsPickerPosition: ContactsPickerPosition.suffix,
    )
Custom borders
 PhoneNumberInput(
    initialCountry: 'TN',
    locale: 'fr',
    countryListMode: CountryListMode.dialog,
    contactsPickerPosition: ContactsPickerPosition.suffix,
    enabledBorder: OutlineInputBorder(
    borderRadius: BorderRadius.circular(10),
    borderSide: const BorderSide(color: Colors.purple)),
    focusedBorder: OutlineInputBorder(
        borderRadius: BorderRadius.circular(10),
        borderSide: const BorderSide(color: Colors.purple))
    )
Select Phone number programmatically

To be able to select a phone number programmatically, we first need to define a PhoneInputController :

PhoneInputController _controller = PhoneInputController(context);
 PhoneNumberInput(
     controller: _controller
    ...

Select the desired phone number:

_controller.phoneNumber = '+1-....'
Note:

If you want to set the phone number from contact, The widget already support this feature without the need to use the controller.

カテゴリー

依存関係

依存関係一覧 2 件

ソースリポジトリ

このパッケージを使用しているプロジェクト

データはまだありません。