Skip to content
pubscout

country_phone_validator

1.0.2, released a year ago by an unverified publisher

Validate phone numbers and retrieve country info using dial codes and lengths.

WASM-ready
$ flutter pub add country_phone_validator
Source repository

What it does

Provides utilities to validate phone numbers based on country codes and length constraints. Also allows retrieving country information such as name, ISO code, dial code, and length limits.

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

Use it when

  • You need to validate phone number inputs against specific country dial codes and lengths.
  • You need to look up country metadata by ISO code or dial code.

Skip it when

  • You require advanced international phone number parsing and formatting library features like Google's libphonenumber.

Strengths

  • Simple and straightforward utility API.
  • Supports validation using min and max length constraints per country.

Weaknesses

  • Relies on basic length and dial code checks rather than full regional phone number parsing rules.

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
0
import 'package:country_phone_validator/country_phone_validator.dart';

void main() {
  String dialCode = "+20";
  String phoneNumber = "1234567890";
  bool isValid = CountryUtils.validatePhoneNumber(phoneNumber, dialCode);
}

Alternatives

Packages that do the same job and could replace country_phone_validator.