Skip to content
pubscout

sealed_countries

3.4.2, released 5 weeks ago by tsin.is

Provides compile-time constant data for world countries using sealed classes.

WASM-ready
$ flutter pub add sealed_countries
Source repository

What it does

Provides data for world countries in the form of sealed classes. Offers compile-time, tree-shakable constants containing ISO 3166 codes, names, capitals, populations, phone codes, and translations for all countries.

AI-written summary of version 3.4.2, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need comprehensive ISO-driven country data in a pure Dart application
  • You want tree-shakable and compile-time constant country information

Skip it when

  • You need Flutter-ready widgets for displaying countries (use world_countries instead)
  • You only need a simple dropdown of countries without detailed metadata

Strengths

  • Complete ISO 3166 coverage for all countries
  • Compile-time constants and tree-shakable
  • Extensive translations and localized names

Weaknesses

  • Does not include Flutter-ready widgets out of the box
  • Large static dataset increases code footprint

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
2
final country = WorldCountry.fromCode("IRL");
print(country.name.common);

Alternatives

Packages that do the same job and could replace sealed_countries.

  • country_codes

    Provides country details, ISO codes, and dial codes based on localization.

  • phonecodes

    Provides a list of countries with names, ISO codes, dial codes, flags, and currencies.

  • country_meta

    Provides structured metadata for countries, including ISO codes, phone codes, currencies, and flags.

Works with

Packages commonly used together with sealed_countries: ones it builds on, ones built on it, and its own family.