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.
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.
- intl_mobile_field
Customized Flutter TextFormField to input international mobile numbers with country codes.
73Compare - flutter_intl_phone_field
International phone number input with country picker, formatting, and validation for 250+ countries.
76Compare - sms_autofill
Flutter plugin to provide SMS code autofill support.
80Compare - world_countries
Compile-time sealed world data with country, currency, language, and phone pickers.
80Compare