https://github.com/arturograu/country_flags
Easy to use library that allows you to render SVG flags of countries and languages
https://github.com/arturograu/country_flags
dart flutter flutter-package library
Last synced: 5 months ago
JSON representation
Easy to use library that allows you to render SVG flags of countries and languages
- Host: GitHub
- URL: https://github.com/arturograu/country_flags
- Owner: arturograu
- License: mit
- Created: 2022-09-22T13:40:54.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2025-12-30T10:30:43.000Z (6 months ago)
- Last Synced: 2026-01-02T23:26:38.166Z (6 months ago)
- Topics: dart, flutter, flutter-package, library
- Language: Dart
- Homepage: https://pub.dev/packages/country_flags
- Size: 6.88 MB
- Stars: 26
- Watchers: 3
- Forks: 45
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# Country Flags
[](https://pub.dev/packages/country_flags)

[](https://github.com/arturograu/country_flags/blob/master/LICENSE)
[](https://codecov.io/gh/arturograu/country_flags)

A Flutter package for displaying the SVG image or the emoji of a country's flag.
The flag can be generated using:
- Country codes
- Language codes
- Currency codes (following the [ISO 4217 standard](https://www.iban.com/currency-codes))
View the complete list of supported countries [here](https://www.iban.com/country-codes).
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).

### Image flags

### Emoji flags

## Installation
Simply add `country_flags` to your [pubspec.yaml](https://flutter.io/using-packages/) file.
```yml
dependencies:
country_flags: ^4.0.0
```
## Usage
### Create a flag using a country code.
`fromCountryCode` supports 2 and 3 letter country code
```dart
CountryFlag.fromCountryCode('ES');
```
or
```dart
CountryFlag.fromCountryCode('ESP');
```
### Create a flag from a language code
```dart
CountryFlag.fromLanguageCode('en');
```
### Create a flag from a Currency code
```dart
CountryFlag.fromCurrencyCode('USD');
```
### Create a flag from a phone prefix
```dart
CountryFlag.fromPhonePrefix('+34');
```
### Tweak the size of the flag
```dart
CountryFlag.fromLanguageCode(
'en',
theme: const ImageTheme(
width: 120,
height: 80,
),
);
```
### Create a circular flag
```dart
CountryFlag.fromCountryCode(
'ES',
theme: const ImageTheme(
shape: Circle(),
),
);
```
### Create a rectangular flag with rounded corners
```dart
CountryFlag.fromCountryCode(
'ES',
theme: const ImageTheme(
shape: RoundedRectangle(6),
),
);
```
### Use the emoji theme
```dart
CountryFlag.fromCountryCode(
'ES',
theme: EmojiTheme(size: 60),
)
```
## Credits
Special thanks to [jovial_svg](https://github.com/zathras/jovial_svg) which is utilized to render the SVG images from binary files.
Many thanks to [bgoncharuck](https://github.com/bgoncharuck) for the implementation.
Acknowledgments to the [flag-icons](https://github.com/lipis/flag-icons) project for providing the necessary SVG flags.
## Alternatives
- [Flag](https://github.com/LunaGao/flag_flutter)