world_countries
4.7.0, released 5 weeks ago by tsin.is
Compile-time sealed world data with country, currency, language, and phone pickers.
What it does
Provides compile-time constant, tree-shakable classes containing ISO world data (countries, currencies, languages, phone codes) and ready-to-use Material widgets and customizable pickers for them. It supports automatic localization via a locale delegate.
AI-written summary of version 4.7.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need country, currency, language, or phone code pickers in your app.
- You want compile-time constant, tree-shakable world data without external API calls.
Skip it when
- You only need a simple color picker or date picker.
- You do not need ISO country or currency data structures.
Strengths
- Tree-shakable and compile-time constant data structures.
- Includes customizable pickers and theme extensions out of the box.
- Built-in automatic translation delegate supporting many locales.
Weaknesses
- Focused exclusively on world data and related pickers, not a general-purpose form builder.
- Adds static dataset overhead if only a tiny fraction of countries are needed (though tree-shakable).
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 3
Add the dependency to pubspec.yaml and optionally register the TypedLocaleDelegate in your MaterialApp for localization.
MaterialApp(
localizationsDelegates: const [
...GlobalMaterialLocalizations.delegates,
TypedLocaleDelegate(),
],
home: Scaffold(
body: Center(
child: CountryPicker(
onSelect: (country) => debugPrint('$country'),
),
),
),
)Alternatives
Packages that do the same job and could replace world_countries.
- flutter_country_selector
A country picker widget to select a country, now re-exported from phone_form_field.
75Compare - flutter_intl_phone_field
International phone number input with country picker, formatting, and validation for 250+ countries.
76Compare - best_form_validator
Zero-initialization form field validators for Flutter with 52 countries and 25 languages.
72Compare - form_builder_phone_field
International phone number input field for the flutter_form_builder package.
70Compare
Works with
Packages commonly used together with world_countries: ones it builds on, ones built on it, and its own family.