fromLanguage static method
Finds countries that speak a specific language.
languageCode
- The language code (e.g., 'en', 'es', 'pt').
Returns a list of countries that have the specified language.
Implementation
static List<Country> fromLanguage(String languageCode) {
final countries = loadCountries();
return countries
.where((country) => country.languages.any((language) =>
language.code.toLowerCase().startsWith(languageCode.toLowerCase())))
.toList();
}