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

country_flags のカバー
パッケージ詳細v4.1.2

country_flags

ISO国コードからフラッグアイコンを表示するためのFlutterパッケージ。

AndroidiOSmacOSWindowsLinux
30日間ダウンロード
21.7万
いいね数
177
Pub ポイント
160

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

flutter pub add country_flags

パッケージ概要

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

country_flags パッケージは、ISO 国家コードを使用して国旗のアイコンを簡単に表示できる Flutter のユーティリティです。アプリに国別フラグをシンプルかつ効率的に組み込む方法を提供し、視覚的な文脈によりユーザー体験を向上させます。Android、iOS、macOS、Windows、Linux など複数のプラットフォームをサポートしており、デバイス間で一貫したレンダリングを確保します。pub add コマンドによる最小限の設定で、既存の Flutter プロジェクトにスムーズに統合できます。国際化、ユーザーの位置情報、地域選択に関連するアプリケーションに最適です。

用途

  • プロフィールにユーザーの国を表示する
  • アプリ内の地域の利用可能性を表示
  • マルチリンガルインターフェースの強化
  • 位置データの可視化
  • フォームでの国選択のサポート
  • 旅行またはソーシャルアプリにフラグを統合する

主な機能

  • シンプルな ISO コード入力
  • クロスプラットフォーム互換性
  • 軽量で高速
  • 事前定義されたフラグアセット
  • pubspec.yaml との簡単な統合
  • 一貫したアイコンスタイル

適している対象

  • 国際化アプリ
  • ユーザープロフィール機能
  • 旅行およびマッピングアプリ
  • マルチリンガルプラットフォーム
  • 位置ベースのサービス
  • 国を視覚化する必要のあるUI

注意事項

  • 有効なISO国コードが必要です
  • 事前に定義されたフラグセットに制限される
  • カスタムフラグのサポートなし
  • アプリのサイズがわずかに増加する可能性があります
  • 外部アセットリポジトリに依存しています
  • 非国際的な国旗には適していません

元の README

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

Country Flags

Pub GitHub Workflow Status (with branch) Pull Requests are welcome codecov Null safety

A Flutter package for displaying the SVG image or the emoji of a country's flag.

The flag can be generated using:

View the complete list of supported countries here.

For a list of supported languages, visit www.lingoes.net/en/translator/langcode.htm (please note that not all language codes on the list are supported).

Showcase

Image flags

Image flags

Emoji flags

Emoji flags

Installation

Simply add country_flags to your pubspec.yaml file.

dependencies:
  country_flags: ^4.0.0

Usage

Create a flag using a country code.

fromCountryCode supports 2 and 3 letter country code

CountryFlag.fromCountryCode('ES');

or

CountryFlag.fromCountryCode('ESP');
Create a flag from a language code
CountryFlag.fromLanguageCode('en');
Create a flag from a Currency code
CountryFlag.fromCurrencyCode('USD');
Create a flag from a phone prefix
CountryFlag.fromPhonePrefix('+34');
Tweak the size of the flag
CountryFlag.fromLanguageCode(
  'en',
  theme: const ImageTheme(
    width: 120,
    height: 80,
  ),
);
Create a circular flag
CountryFlag.fromCountryCode(
  'ES',
  theme: const ImageTheme(
    shape: Circle(),
  ),
);
Create a rectangular flag with rounded corners
CountryFlag.fromCountryCode(
  'ES',
  theme: const ImageTheme(
    shape: RoundedRectangle(6),
  ),
);
Use the emoji theme
CountryFlag.fromCountryCode(
  'ES',
  theme: EmojiTheme(size: 60),
)

Credits

Special thanks to jovial_svg which is utilized to render the SVG images from binary files. Many thanks to bgoncharuck for the implementation.

Acknowledgments to the flag-icons project for providing the necessary SVG flags.

Alternatives

カテゴリー

依存関係

依存関係一覧 2 件

ソースリポジトリ

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

ランキング