fromCurrency static method

List<Country> fromCurrency(
  1. String currencyCode
)

Finds countries that use a specific currency.

currencyCode - The 3-letter currency code (e.g., 'USD', 'EUR'). Returns a list of countries that use the specified currency.

Implementation

static List<Country> fromCurrency(String currencyCode) {
  final countries = loadCountries();
  return countries
      .where((country) => country.currencies.any((currency) =>
          currency.code.toUpperCase() == currencyCode.toUpperCase()))
      .toList();
}