CountryDropdown constructor

const CountryDropdown({
  1. Key? key,
  2. CountryItemBuilder? selectedItemBuilder,
  3. CountryItemBuilder? listItemBuilder,
  4. bool printCountryName = false,
  5. PhoneCountryData? initialCountryData,
  6. bool triggerOnCountrySelectedInitially = true,
  7. List<PhoneCountryData>? filter,
  8. required ValueChanged<PhoneCountryData> onCountrySelected,
  9. int elevation = 8,
  10. TextStyle? style,
  11. Widget? icon,
  12. Color? iconDisabledColor,
  13. Color? iconEnabledColor,
  14. double iconSize = 24.0,
  15. double? itemHeight = 60.0,
  16. Color? focusColor,
  17. FocusNode? focusNode,
  18. bool autofocus = false,
  19. Color? dropdownColor,
  20. InputDecoration? decoration,
  21. FormFieldValidator<PhoneCountryData>? validator,
  22. AutovalidateMode? autovalidateMode,
  23. double? menuMaxHeight,
  24. bool? enableFeedback,
  25. AlignmentGeometry alignment = AlignmentDirectional.centerStart,
})

filter if you need a predefined list of countries only, pass it here initialCountryData initial country data to be selected selectedItemBuilder use this if you want to make the selected item look the way you want listItemBuilder the same as selectedItemBuilder but to present items in an open list printCountryName if true, it will display a country name under its flat and country code while the menu is open triggerOnCountrySelectedInitially if you don't want onCountrySelected to be triggered right away if you set an initialPhoneCode param, pass false here. Description is here https://github.com/caseyryan/flutter_multi_formatter/issues/122

Implementation

const CountryDropdown({
  Key? key,
  this.selectedItemBuilder,
  this.listItemBuilder,
  this.printCountryName = false,
  this.initialCountryData,
  this.triggerOnCountrySelectedInitially = true,
  this.filter,
  required this.onCountrySelected,
  this.elevation = 8,
  this.style,
  this.icon,
  this.iconDisabledColor,
  this.iconEnabledColor,
  this.iconSize = 24.0,
  this.itemHeight = 60.0,
  this.focusColor,
  this.focusNode,
  this.autofocus = false,
  this.dropdownColor,
  this.decoration,
  this.validator,
  this.autovalidateMode,
  this.menuMaxHeight,
  this.enableFeedback,
  this.alignment = AlignmentDirectional.centerStart,
}) : super(key: key);