country_flags
4.1.2, released 10 months ago by fluttered.io
Displays country flags as SVG or emoji using ISO country, language, currency, or phone prefix codes
What it does
CountryFlag widgets render flag images or emoji for a given country code, language code, currency code, or phone prefix. The package supports custom sizing, shapes, and themes, and uses jovial_svg for efficient SVG rendering.
AI-written summary of version 4.1.2, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to show a country flag in a Flutter UI
- You want to support multiple flag representations (SVG, emoji)
- You need quick flag lookup by country, language, currency, or phone prefix
Skip it when
- You require highly customized flag graphics beyond the provided shapes
- You need flags that change dynamically based on user input beyond static codes
Strengths
- Simple API with multiple lookup methods
- Supports both SVG and emoji styles
- Customizable size, shape, and theme
Weaknesses
- Limited to flag display only
- No support for dynamic flag updates or custom graphics
- Relies on external SVG assets
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 2
CountryFlag.fromCountryCode('ES', theme: const ImageTheme(shape: Circle()));Alternatives
Packages that do the same job and could replace country_flags.
- app_badge_plus
Flutter plugin to set numeric badges on app icons for iOS, Android, and macOS
84Compare - circle_flags
Provides a CircleFlag widget to display circular country flag SVGs.
76Compare - world_flags
Collection of more than 250 vector-based world flags rendered as widgets without assets.
82Compare - re_editor
A lightweight text and code editor widget for Flutter with syntax highlighting and folding.
80Compare
Works with
Packages commonly used together with country_flags: ones it builds on, ones built on it, and its own family.
- jovial_svgcountry_flags depends on itSVG - Robust rendering of Scalable Vector Graphic images, supporting a well-defined profile of SVG, a fast-loading binary storage format, and animation.
- intl_phone_number_fieldBuilt on country_flagsCustomised Flutter TextFormField to input international phone numbers with country codes.