DropDownTextField constructor
const
DropDownTextField({
- Key? key,
- dynamic controller,
- dynamic initialValue,
- required List<
DropDownValueModel> dropDownList, - EdgeInsets? padding,
- TextStyle? textStyle,
- ValueSetter? onChanged,
- FormFieldValidator<
String> ? validator, - bool isEnabled = true,
- bool enableSearch = false,
- bool readOnly = true,
- double dropdownRadius = 12,
- InputDecoration? textFieldDecoration,
- IconProperty? dropDownIconProperty,
- int dropDownItemCount = 6,
- TextStyle? searchTextStyle,
- FocusNode? searchFocusNode,
- FocusNode? textFieldFocusNode,
- bool searchAutofocus = false,
- InputDecoration? searchDecoration,
- bool? searchShowCursor,
- TextInputType? searchKeyboardType,
- double listSpace = 0,
- bool clearOption = true,
- IconProperty? clearIconProperty,
- ListPadding? listPadding,
- TextStyle? listTextStyle,
- TextInputType? keyboardType,
- AutovalidateMode? autovalidateMode,
- BoxDecoration? boxDecoration,
- EdgeInsets? boxMargin,
Implementation
const DropDownTextField({
super.key,
this.controller,
this.initialValue,
required this.dropDownList,
this.padding,
this.textStyle,
this.onChanged,
this.validator,
this.isEnabled = true,
this.enableSearch = false,
this.readOnly = true,
this.dropdownRadius = 12,
this.textFieldDecoration,
this.dropDownIconProperty,
this.dropDownItemCount = 6,
this.searchTextStyle,
this.searchFocusNode,
this.textFieldFocusNode,
this.searchAutofocus = false,
this.searchDecoration,
this.searchShowCursor,
this.searchKeyboardType,
this.listSpace = 0,
this.clearOption = true,
this.clearIconProperty,
this.listPadding,
this.listTextStyle,
this.keyboardType,
this.autovalidateMode,
this.boxDecoration,
this.boxMargin,
}) : assert(
!(initialValue != null && controller != null),
"you cannot add both initialValue and singleController,\nset initial value using controller \n\tEg: SingleValueDropDownController(data:initial value) ",
),
assert(
!(!readOnly && enableSearch),
"readOnly!=true or enableSearch=true both condition does not work",
),
assert(
!(controller != null && controller is! SingleValueDropDownController),
"controller must be type of SingleValueDropDownController",
),
checkBoxProperty = null,
isMultiSelection = false,
singleController = controller,
multiController = null,
displayCompleteItem = false,
submitButtonColor = null,
submitButtonText = null,
submitButtonTextStyle = null;