Skip to content
pubscout

phonecodes

0.0.4, released 2 years ago by weaverlabs.ca

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

WASM-ready
$ flutter pub add phonecodes
Source repository

What it does

The package supplies enums and helper methods for accessing global country and currency data. Developers can find countries and currencies by name, ISO code, or dial code.

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

Use it when

  • You are building a phone number input field or authentication flow.
  • You need a quick lookup of country codes, flags, and currencies.

Skip it when

  • You require complex phone number parsing and validation beyond basic country codes.

Strengths

  • Includes ready-to-use Country and Currency enums.
  • Provides convenient lookup methods by code, name, and dial code.
  • Zero dependencies.

Weaknesses

  • Limited to static country and currency data lists.
  • Does not include advanced phone number formatting or validation features.

Setup

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

void main() {
  final Country country = Countries.findByCode('IN');
  print(country.name); // Output: India
}

Alternatives

Packages that do the same job and could replace phonecodes.

  • sealed_countries

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

  • country_codes

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

  • country_meta

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

  • l10n_currencies

    Provides CLDR-like currency name translations for 149 locales in pure Dart with zero dependencies.