Skip to content
pubscout

flag

7.1.0, released 6 weeks ago by maomishen.com

A Flutter package to display country flags using SVG assets.

WASM-readyRock solid
$ flutter pub add flag
Source repository

What it does

Provides easy-to-use widgets to display national, regional, and international flags using ISO country codes or custom strings. It leverages flutter_svg under the hood and syncs flag graphics with the popular flag-icons repository.

AI-written summary of version 7.1.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to display country flags in your user profile, settings, or language selection screens.
  • You want support for standard ISO 3166-1-alpha-2 country codes as well as various disputed territories and international organizations.

Skip it when

  • You already use an alternative package from the catalog that fulfills your flag-rendering needs.

Strengths

  • Supports multiple flag dimensions and shapes (like 1x1, 4x3, rounded flags).
  • Uses vector graphics (SVG) ensuring crisp rendering across different screen densities.
  • Continuously synced with flag-icons library releases.

Weaknesses

  • Relies on external SVG asset updates to keep flags accurate.
  • Limited to flag rendering functionality only.

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
2

Simply add the package to your pubspec.yaml and start using the Flag widget.

Flag.fromCode(
    FlagsCode.US, 
    height: 100, 
    width: 100 * 4 / 3,
)

Alternatives

Packages that do the same job and could replace flag.

Works with

Packages commonly used together with flag: ones it builds on, ones built on it, and its own family.