country_icons
3.0.0, released 3 years ago by an unverified publisher
Provides PNG and SVG country flag assets for Flutter apps.
What it does
The package bundles a large collection of country flag icons in PNG and SVG formats. It exposes them as assets that can be loaded with Image.asset or SvgPicture.asset, and also offers a helper method to retrieve SVG flags by country code.
AI-written summary of version 3.0.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need a ready‑made set of country flags without network requests
- You want simple, offline assets for UI elements like dropdowns or lists
Skip it when
- You require flags that are not included in the collection
- You need runtime updates or custom styling beyond the provided SVGs
Strengths
- Large, up‑to‑date flag collection
- Supports both PNG and SVG
- Easy to use with standard Flutter asset loading
Weaknesses
- Adds a sizable amount of assets to the app bundle
- Limited to the flags provided in the package
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 1
Add the package to pubspec.yaml; include flutter_svg if you use SVG flags.
import 'package:flutter_svg/flutter_svg.dart';
import 'package:country_icons/country_icons.dart';
// PNG
Image.asset('icons/flags/png1000px/de.png', package: 'country_icons');
// SVG via helper
SvgPicture.asset(CountryIcons.getSvgFlag('de'), package: 'country_icons');Alternatives
Packages that do the same job and could replace country_icons.
- country_flags
Another flag‑icon package with a similar asset‑based approach
69Compare
Works with
Packages commonly used together with country_icons: ones it builds on, ones built on it, and its own family.