Search packages, repositories and app categories

flag cover
Package detailsv7.1.0

flag

A flag Flutter package. Use for showing flags. All flags came from https://github.com/lipis/flag-icons/releases/tag/v4.1.4 .

AndroidiOSWebmacOSWindowsLinux
30-day downloads
53.2K
Likes
164
Pub points
160

Install package

flutter pub add flag

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

The flag package is a Flutter library that provides a collection of country flags sourced from the flag-icons repository. It enables developers to easily display high-quality, standardized flags in their Flutter applications across multiple platforms. The package supports Android, iOS, Web, macOS, Windows, and Linux, ensuring consistent flag rendering regardless of the target environment. With minimal setup via `flutter pub add flag`, it's ideal for apps requiring country identification, language selection, or regional customization.

Use cases

  • Displaying country flags in user interfaces
  • Language or region selection screens
  • Internationalization (i18n) features
  • User profile or location indicators
  • Travel or global event applications

Key features

  • Preloaded flags from flag-icons v4.1.4
  • Cross-platform compatibility
  • Simple integration with Flutter
  • High-resolution flag assets
  • Lightweight and fast rendering

Suitable for

  • Apps with international users
  • Multilingual applications
  • Global travel or event platforms
  • UIs requiring visual country representation

Considerations

  • Flags are static images; no animation support
  • Limited to the flags available in the source release
  • No built-in flag search or filtering
  • Requires manual updates for new flag additions

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

Logo

flag

Pub Version Bless

A flag Flutter package for Android / iOS / Web. Based by package:flutter_svg .

Screenshot

Screenshot

Svg sources

  • All flags came from https://github.com/lipis/flag-icons/releases/tag/v4.1.4

Thanks the great project flag-icons.

Flag list

ISO 3166-1-alpha-2 Flags

Note:

Organisations

  • eu European Union.

Disputed territories

  • hk Hong Kong. Special Administrative Region of China.
  • mo Macau. Special Administrative Region of China.
  • eh Western Sahara. Claimed by Morocco.
  • tw Taiwan. Claimed by China.

Undisputed territories which are non-UN state

  • va Vatican City. Govern by the Holy See.

How to use

Flag.fromCode(
    FlagsCode.COUNTRY_CODE, 
    height: HEIGHT, 
    width: WIDTH,
)
Flag.fromString(
    COUNTRY_CODE, 
    height: HEIGHT, 
    width: WIDTH,
)
Flags.fromCode(
    [
        FlagsCode.GB, 
        FlagsCode.US
    ], 
    height: 100, 
    width: 100 * 4 / 3,
)

Such as

  • Flag.fromCode(FlagsCode.AD, height: 100, width: null)
  • Flag.fromString('AD', height: null, width: null)
  • Flag.fromString('AD', height: 10, width: 100, fit: BoxFit.fill)

for developers

How to publish https://docs.flutter.dev/packages-and-plugins/developing-packages#publish

Star History

Star History Chart

Categories

Dependencies

Dependency list 2 items

Source repository

Projects using this package