Skip to content
pubscout

country_code

1.2.0, released 9 days ago by an unverified publisher

Provides ISO 3166-1 country codes in an enum-like class with parsing and user-assigned elements.

WASM-ready
$ flutter pub add country_code
Source repository

What it does

Provides a list of ISO 3166-1 alpha-2, alpha-3, and numeric country codes inside an enum-like class. It allows parsing country codes from strings and supports user-assigned code elements.

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

Use it when

  • You need to validate or parse ISO 3166-1 country codes in your Dart or Flutter application.
  • You require access to alpha-2, alpha-3, and numeric country representations.

Skip it when

  • You need complete localized country names and translations for UI displays.
  • You require complex geo-location or timezone mapping utilities.

Strengths

  • Supports ISO 3166-1 alpha-2, alpha-3, and numeric codes
  • Includes parsing capabilities and user-assigned code elements
  • No external dependencies

Weaknesses

  • Limited feature set beyond basic country code parsing and listing
  • Does not document built-in UI pickers or full country names

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
0
import 'package:country_code/country_code.dart';

var code = CountryCode.tryParse("US");
if (code == CountryCode.US) {
  print(code.alpha2);
  print(code.alpha3);
  print(code.numeric);
}

Alternatives

Packages that do the same job and could replace country_code.