mapCountryToDropdownItem method

List<DropdownMenuItem<Country>> mapCountryToDropdownItem(
  1. List<Country> countries
)

Converts the list countries to DropdownMenuItem

Implementation

List<DropdownMenuItem<Country>> mapCountryToDropdownItem(
    List<Country> countries) {
  return countries.map((country) {
    return DropdownMenuItem<Country>(
      value: country,
      child: Item(
        country: country,
        showFlag: selectorConfig.showFlags,
        useEmoji: selectorConfig.useEmoji,
        textStyle: selectorTextStyle,
        withCountryNames: false,
      ),
    );
  }).toList();
}