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

GitHub リポジトリThe0xArchitect/phonecodes

phonecodes

国名、ISOコード、ダイヤルコード、国旗を含む国リストを提供するDartおよびFlutterパッケージです。

phonecodes のプロジェクト画像
スター
5
フォーク
6
最終プッシュ(UTC)
2025/03/15
プロジェクト状態
公開中

元の README

以下は英語原文のスナップショットです。最新版は GitHub をご覧ください。

PhoneCodes

Version License GitHub Stars

Overview

The PhoneCodes package is a comprehensive tool for Flutter and Dart developers, offering a convenient list of all countries along with essential details such as country dial codes, ISO codes, flags, and currencies. Whether you're building a phone authentication flow or integrating phone number input functionality, this package simplifies the process by providing easy access to crucial country information.

Features

  • Country Enumeration: Utilize the Country enum to effortlessly access country details including name, ISO code, dial code, and flag.
  • Currency Enumeration: Access currency information such as name, code, and symbol through the Currency enum.
  • Flexible API: The package offers a variety of methods within the Countries class, enabling developers to find countries by code, name, dial code, or through custom filters.
  • Easy Integration: Simply import the package and start using predefined country and currency enums, eliminating the need for manual data collection.

Installation

To use the PhoneCodes package in your Flutter/Dart project, add the following dependency to your pubspec.yaml file:

dependencies:
  phonecodes: <latest>

Then, run flutter pub get to install the package.

Usage

Country Enumeration
import 'package:phonecodes/phonecodes.dart';

void main() {
  // Access country details by enum
  print(Country.india.name);            // Output: India
  print(Country.india.code);            // Output: IN
  print(Country.india.dialCode);        // Output: +91
  print(Country.india.flag);            // Output: 🇮🇳
  print(Country.india.currency.symbol)  // Output: ₹
}
Currency Enumeration
import 'package:phonecodes/phonecodes.dart';

void main() {
  // Access currency details by enum
  print(Currency.inr.name);    // Output: Indian Rupee
  print(Currency.inr.code);    // Output: INR
  print(Currency.inr.symbol);  // Output: ₹
}
Country Lookup
import 'package:phonecodes/phonecodes.dart';

void main() {
  // Find country by ISO code
  final Country country = Countries.findByCode('IN');
  print(country.name); // Output: India

  // Find country by name
  final Country country2 = Countries.findByName('United States');
  print(country2.dialCode); // Output: +1

  // Find country by dial code
  final Country country3 = Countries.findByDialCode('+44').first;
  print(country3.flag); // Output: 🇬🇧
}

Contributing

Contributions to the PhoneCodes package are welcome! If you encounter any issues or have suggestions for improvements, please feel free to submit a pull request or open an issue on the GitHub repository.

License

This package is licensed under the MIT License. See the LICENSE file for more details.


PhoneCodes - Making country and currency information easily accessible for Flutter/Dart developers. Happy coding! 🚀🌍💰

0xArchitect GitHub avatar
GitHub 作者

0xArchitect ↗

Blackholes • Night Skies • Beaches.

@theweaverlabsProbably around localhost
言語Dart

カテゴリー

使用している依存関係

依存関係一覧 2 件

プロジェクトに合うリポジトリを選ぶには?

用途で絞り込み、開発状況を比較し、採用前に元のリポジトリで要件を確認しましょう。

  1. 名前・作者・説明で検索し、技術トピックで絞り込みます。
  2. スター、フォーク、最近のプッシュを比較します。スターは関心の目安であり、品質の保証ではありません。
  3. 利用前に GitHub で README、ライセンス、Issues を確認します。

情報源と管理

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗