country_meta 0.0.1
country_meta: ^0.0.1 copied to clipboard
A Dart-only package that provides structured metadata for all countries, including ISO codes, phone codes, currencies, localized names, and flag image URLs.
import 'package:country_meta/country_meta.dart';
void main() {
final country = CountryRepository.byAlpha2('US');
if (country != null) {
print('Name: ${country.localizedName('en_US')}');
print('Currency: ${country.currency} (${country.currencySymbol})');
print('Phone: ${country.phoneCode}');
print('Flag (SVG): ${country.flagUrl()}');
print(
'Flag (JPEG): ${country.flagUrl(format: FlagImageFormat.jpeg, height: FlagHeight.h160)}');
print(
'Flag (WebP): ${country.flagUrl(format: FlagImageFormat.webp, width: FlagWidth.w320)}');
} else {
print('Country not found.');
}
}