Skip to main content

worldref 1.1.0 copy "worldref: ^1.1.0" to clipboard
worldref: ^1.1.0 copied to clipboard

Every country in Arabic, English, or both, with nationalities, dial codes, phone validation, Arabic-aware search and sorting.

worldref (Dart / Flutter) #

Countries and territories in Arabic and English: names, ISO codes, phone plans, currencies, geo, locale, search and sorting. No runtime dependencies; works in Flutter, including web.

Install from GitHub #

dependencies:
  worldref: { git: { url: https://github.com/arj-89/worldref.git, ref: v1.1.0, path: dart } }

Usage #

import 'package:worldref/worldref.dart';

final sa = byIso2('sa')!;                              // case-insensitive lookup
print(sa.nameAr);                                      // السعودية
print(search(countries, 'مملكة', Lang.ar).first.iso2); // SA
print(sortCountries(countries, Lang.ar, 'SA').first.iso2);
final p = parsePhone('0501234567', sa, countries);
print('${p?.e164} ${p?.valid} ${p?.mobile}');          // +966501234567 true true
print(isValidMobile('+966501234567', sa, countries));
print(subdivisionsOf('SA').length);

API: countries, byIso2, subdivisions, subdivisionsOf, normalize, westernDigits, search, sortCountries, parsePhone, isValidMobile, formatNational. Data is parsed lazily on first use.

Test #

cd dart && dart pub get && dart test
0
likes
0
points
304
downloads

Publisher

unverified uploader

Weekly Downloads

Every country in Arabic, English, or both, with nationalities, dial codes, phone validation, Arabic-aware search and sorting.

Homepage
Repository (GitHub)
View/report issues

Topics

#countries #arabic #i18n #phone #dataset

License

unknown (license)

More

Packages that depend on worldref