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

パッケージ詳細v1.0.4

international_phone_input

Flutter用の国際電話番号入力。このパッケージは、libphonenumberパッケージを使用して電話番号の入力値を検証します。

30日間ダウンロード
84
いいね数
43
Pub ポイント
40

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

flutter pub add international_phone_input

パッケージ概要

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

libphonenumber ライブラリを使用した組み込み検証機能を備えた国際電話番号入力のための Flutter パッケージです。国ごとの基準に従って電話番号を入力およびフォーマットするユーザーに優しいインターフェースを提供し、グローバルなユーザー間での正確なデータ収集を保証します。このパッケージは、入力または選択されたデフォルトに基づいて国を自動的に検出するとともに、適切なフォーマットを適用し、リアルタイムで入力された番号を検証します。

用途

  • グローバルユーザー登録
  • 国際連絡フォーム
  • 電話番号の検証ワークフロー
  • マルチリージョンモバイルアプリケーション
  • ECオーダー決済プロセス

主な機能

  • リアルタイムの電話番号検証
  • 自動国コード検出
  • マスク付きのフォーマットされた入力
  • すべての主要国をサポートしています
  • libphonenumber との統合

適している対象

  • 国際的な視聴者をターゲットにしたアプリ
  • 有効な電話番号を必要とするフォーム
  • 堅牢な入力検証が必要な開発者
  • 国際化を使用するプロジェクト
  • コンプライアンス要件を満たすアプリケーション

注意事項

  • 完全な国データベース照会にはインターネット接続が必要です
  • libphonenumber 依存関係により、アプリのサイズが増加する可能性があります
  • UI コンポーネントのカスタマイズが限定的
  • オフライン検証のサポートなし
  • 外部ライブラリの更新に依存

元の README

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

international_phone_input

International Phone Number Input For Flutter

Usage

Just put the component in your application.

import 'package:international_phone_input/international_phone_input.dart';

String phoneNumber;
String phoneIsoCode;

void onPhoneNumberChange(String number, String internationalizedPhoneNumber, String isoCode) {
    setState(() {
       phoneNumber = number;
       phoneIsoCode = isoCode;
    });
}

// Default Widget with dropdown list
@override
 Widget build(BuildContext context) => Scaffold(
     body: Center(
       child: InternationalPhoneInput(
          onPhoneNumberChange: onPhoneNumberChange, 
          initialPhoneNumber: phoneNumber,
          initialSelection: phoneIsoCode,
          enabledCountries: ['+233', '+1']
       ),
     ),
 );

// Widget with text input only

 onValidPhoneNumber(
      String number, String internationalizedPhoneNumber, String isoCode) {
    setState(() {
      confirmedNumber = internationalizedPhoneNumber;
    });
  }

@override
 Widget build(BuildContext context) => Scaffold(
     body: Center(
       child:  InternationalPhoneInputText(
         onValidPhoneNumber: onValidPhoneNumber,
        ),
     ),
 );

// Widget with decoration
// Using decoration overwrites other styles such as hintStyle, hintText, etc.

@override
 Widget build(BuildContext context) => Scaffold(
     body: Center(
       child: InternationalPhoneInput(
          decoration: InputDecoration.collapsed(hintText: '(416) 123-4567'),
          onPhoneNumberChange: onPhoneNumberChange, 
          initialPhoneNumber: phoneNumber,
          initialSelection: phoneIsoCode,
          enabledCountries: ['+233', '+1'],
          showCountryCodes: false
       ),
     ),
 );

Customization

Here is a list of properties available to customize the widget:

Name Type Description
initialPhoneNumber String used to set initial phone number
initialSelection String used to set initial country code
errorText String use this to set an error message
hintText String sets hint
labelText String sets label
errorStyle TextStyle style applied to error message
hintStyle TextStyle style applied to hint
labelStyle TextStyle style applied to label
errorMaxLines int the maximum number of lines user can type
enabledCountries List the list of enabled countries to display
decoration InputDecoration decoration applied to the TextField widget
showCountryCodes bool shows the country code (default true)
showCountryFlags bool shows. the country flags (default true)
dropdownIcon Widget use this to customize dropdown icon

Contributions

Contributions of any kind are more than welcome! Feel free to fork and improve international_phone_input in any way you want, make a pull request, or open an issue.

カテゴリー

依存関係

依存関係一覧 1 件

ソースリポジトリ

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