CountryCodePicker constructor

const CountryCodePicker({
  1. ValueChanged<CountryCode>? onChanged,
  2. ValueChanged<CountryCode?>? onInit,
  3. String? initialSelection,
  4. List<String> favorite = const [],
  5. TextStyle? textStyle,
  6. EdgeInsetsGeometry padding = const EdgeInsets.all(8.0),
  7. EdgeInsetsGeometry? margin,
  8. bool showCountryOnly = false,
  9. InputDecoration searchDecoration = const InputDecoration(),
  10. TextStyle? searchStyle,
  11. TextStyle? dialogTextStyle,
  12. WidgetBuilder? emptySearchBuilder,
  13. bool showOnlyCountryWhenClosed = false,
  14. bool alignLeft = false,
  15. bool showFlag = true,
  16. bool? showFlagDialog,
  17. bool hideMainText = false,
  18. bool? showFlagMain,
  19. Decoration? flagDecoration,
  20. dynamic builder(
    1. CountryCode?
    )?,
  21. double flagWidth = 32.0,
  22. bool enabled = true,
  23. TextOverflow textOverflow = TextOverflow.ellipsis,
  24. Color? barrierColor,
  25. Color? backgroundColor,
  26. BoxDecoration? boxDecoration,
  27. Comparator<CountryCode>? comparator,
  28. List<String>? countryFilter,
  29. bool hideSearch = false,
  30. bool hideCloseIcon = false,
  31. bool showDropDownButton = false,
  32. Size? dialogSize,
  33. Color? dialogBackgroundColor,
  34. Icon closeIcon = const Icon(Icons.close),
  35. List<Map<String, String>> countryList = codes,
  36. PickerStyle pickerStyle = PickerStyle.dialog,
  37. EdgeInsetsGeometry dialogItemPadding = const EdgeInsets.symmetric(horizontal: 24, vertical: 8),
  38. EdgeInsetsGeometry searchPadding = const EdgeInsets.symmetric(horizontal: 24),
  39. MainAxisAlignment headerAlignment = MainAxisAlignment.spaceBetween,
  40. String? headerText = "Select Country",
  41. TextStyle headerTextStyle = const TextStyle(fontSize: 18, fontWeight: FontWeight.bold),
  42. bool hideHeaderText = false,
  43. EdgeInsets topBarPadding = const EdgeInsets.symmetric(vertical: 5.0, horizontal: 20),
  44. Key? key,
})

Implementation

const CountryCodePicker({
  this.onChanged,
  this.onInit,
  this.initialSelection,
  this.favorite = const [],
  this.textStyle,
  this.padding = const EdgeInsets.all(8.0),
  this.margin,
  this.showCountryOnly = false,
  this.searchDecoration = const InputDecoration(),
  this.searchStyle,
  this.dialogTextStyle,
  this.emptySearchBuilder,
  this.showOnlyCountryWhenClosed = false,
  this.alignLeft = false,
  this.showFlag = true,
  this.showFlagDialog,
  this.hideMainText = false,
  this.showFlagMain,
  this.flagDecoration,
  this.builder,
  this.flagWidth = 32.0,
  this.enabled = true,
  this.textOverflow = TextOverflow.ellipsis,
  this.barrierColor,
  this.backgroundColor,
  this.boxDecoration,
  this.comparator,
  this.countryFilter,
  this.hideSearch = false,
  this.hideCloseIcon = false,
  this.showDropDownButton = false,
  this.dialogSize,
  this.dialogBackgroundColor,
  this.closeIcon = const Icon(Icons.close),
  this.countryList = codes,
  this.pickerStyle = PickerStyle.dialog,
  this.dialogItemPadding = const EdgeInsets.symmetric(horizontal: 24, vertical: 8),
  this.searchPadding = const EdgeInsets.symmetric(horizontal: 24),
  this.headerAlignment = MainAxisAlignment.spaceBetween,
  this.headerText = "Select Country",
  this.headerTextStyle = const TextStyle(fontSize: 18, fontWeight: FontWeight.bold),
  this.hideHeaderText = false,
  this.topBarPadding = const EdgeInsets.symmetric(vertical: 5.0, horizontal: 20),
  Key? key,
}) : super(key: key);