WorldPickerService class

A comprehensive service for managing and querying world country data.

This service provides static methods to access country information, search and filter countries by various criteria, and retrieve related geographical and cultural data.

All methods are optimized with caching for better performance. The country data includes all 195 UN-recognized countries with complete metadata including flags, currencies, languages, and more.

Example usage:

// Get a specific country
Country? brazil = WorldPickerService.fromIsoCode('BR');

// Search countries
List<Country> results = WorldPickerService.fromCountryName('united');

// Get all countries in a continent
List<Country> europeanCountries = WorldPickerService.fromContinentCode('EU');

Constructors

WorldPickerService.new()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

countries List<Country>
Gets all countries with caching for improved performance. Returns a sorted list of all available countries.
no setter

Static Methods

clearCache() → void
Clears the cached countries data.
continents() List<Continent>
Retrieves all unique continents from the countries dataset.
countriesCount() int
Gets the total count of countries.
currencies({String? name, String? code, String? symbol}) List<Currency>
Retrieves all unique currencies from the countries dataset.
defaultCountry() Country
fromContinentCode(String continentCode) List<Country>
Retrieves all countries within a specific continent.
fromCountryName(String query) List<Country>
Searches for countries by name using case-insensitive partial matching.
fromCurrency(String currencyCode) List<Country>
Finds countries that use a specific currency.
fromIsoCode(String isoCode) Country?
Finds a specific country by its ISO 3166-1 alpha-2 code.
fromIsoCodes(List<String> isoCodes) List<Country>
Finds countries by a list of ISO codes.
fromLanguage(String languageCode) List<Country>
Finds countries that speak a specific language.
languages() List<Language>
Retrieves all unique languages from the countries dataset.
loadCountries() List<Country>
Loads and returns all countries from the data source.
loadLanguages() List<Language>
Return all languages Return a List<Language> of all unique languages found across all countries.