CountryDropdown constructor
const
CountryDropdown({
- Key? key,
- CountryItemBuilder? selectedItemBuilder,
- CountryItemBuilder? listItemBuilder,
- bool printCountryName = false,
- PhoneCountryData? initialCountryData,
- bool triggerOnCountrySelectedInitially = true,
- List<
PhoneCountryData> ? filter, - required ValueChanged<
PhoneCountryData> onCountrySelected, - int elevation = 8,
- TextStyle? style,
- Widget? icon,
- Color? iconDisabledColor,
- Color? iconEnabledColor,
- double iconSize = 24.0,
- double? itemHeight = 60.0,
- Color? focusColor,
- FocusNode? focusNode,
- bool autofocus = false,
- Color? dropdownColor,
- InputDecoration? decoration,
- FormFieldValidator<
PhoneCountryData> ? validator, - AutovalidateMode? autovalidateMode,
- bool? enableFeedback,
- 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);