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.
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.
- string_scanner
A class for parsing strings using a sequence of patterns.
81Compare - emoji_flag_converter
Convert alpha-2 country codes to emoji flags in Dart.
47Compare - intersperse
Insert a given element between each element of an Iterable or List.
50Compare - isoweek
Lightweight Dart package providing the Week class based on the ISO 8601 format.
49Compare