FLUTTER ECOSYSTEM

arturograu/country_flags

Einfach zu verwendende Bibliothek, mit der Sie SVG-Flaggen von Ländern und Sprachen darstellen können

Projektcover von country_flags
Stars
27
Forks
49
Letzter Push (UTC)
26.01.2026
Projektstatus
Aktiv
Arturo Grau GitHub avatar
GITHUB User

Arturo Grau ↗

@labhousemobileValencia, SpainOffizielle Website ↗
SprachenDartHTMLSwiftKotlinObjective-C

Technische Themen

Von diesem Repository veröffentlichte Pakete

Verwendete Abhängigkeiten

Abhängigkeiten 6 Einträge

Original-README

Englischer Projektschnappschuss. Aktuelle Inhalte auf GitHub.

Projekt-README ein-/ausklappen

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