getCountriesByCountriesCode function

List<Country> getCountriesByCountriesCode(
  1. List<String> countriesCode,
  2. List<Country> countries
)

Implementation

List<Country> getCountriesByCountriesCode(
    List<String> countriesCode, List<Country> countries) {
  // Filter the countries based on the provided country codes
  return countries
      .where((country) => countriesCode.contains(country.code))
      .toList();
}