world_flags
3.6.0, released 5 weeks ago by tsin.is
Collection of more than 250 vector-based world flags rendered as widgets without assets.
What it does
Provides over 250 vector-based country, language, and currency flags implemented as CustomPainters. Flags adapt to any size and shape while maintaining true proportions without using image, SVG, or font assets. Includes support for custom styling and shaders.
AI-written summary of version 3.6.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to display world country flags without bundling heavy image or SVG assets.
- You need flags to dynamically adapt their size, shape, or aspect ratio in the UI.
Skip it when
- You require traditional raster or asset-based flag graphics rather than code-driven CustomPainters.
Strengths
- Zero assets used, keeping app bundle size lightweight.
- Fully customizable shapes, aspect ratios, and styles via Flutter widgets and custom painters.
- Includes more than 250 declarative world flags following official color standards.
Weaknesses
- Limited to the provided collection of world, language, and currency flags.
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 2
Add world_flags as a dependency in your pubspec.yaml file.
import 'package:flutter/material.dart';
import 'package:world_flags/world_flags.dart';
class Main extends StatelessWidget {
const Main({super.key});
@override
Widget build(BuildContext context) => const Material(
child: Center(
child: CountryFlag(CountryDeu()),
),
);
}Alternatives
Packages that do the same job and could replace world_flags.
- circle_flags
Provides a CircleFlag widget to display circular country flag SVGs.
76Compare - country_picker
A Flutter widget to pick a country from a list with optional phone code and search.
78Compare - country_flags
Displays country flags as SVG or emoji using ISO country, language, currency, or phone prefix codes
69Compare - dash_flags
Flutter widgets to display country, language, and timezone flags.
50Compare
Works with
Packages commonly used together with world_flags: ones it builds on, ones built on it, and its own family.
- material_uiworld_flags depends on itOfficial Flutter Material UI library implementing Google’s Material Design system.
- sealed_countriesworld_flags depends on itProvides compile-time constant data for world countries using sealed classes.
- world_countriesBuilt on world_flagsCompile-time sealed world data with country, currency, language, and phone pickers.