Dropdown constructor
const
Dropdown({
- Key? key,
- Type dropdownType = Type.singleSelect,
- DropdownSubtype dropdownSubtype = DropdownSubtype.defaultSelect,
- TextEditingController? textEditingController,
- void onChange()?,
- List<
DropdownItem> items = const [], - List<
DropdownItem> options = const [], - IconData? textIcon,
- bool readOnly = false,
- IconData suffixIcon = Icons.arrow_drop_down,
- String emptyItemText = "No Options available",
- bool isSearchable = true,
- DropdownItem? selectedOption,
- bool isDisabled = false,
- List<
ValueMapper> ? valueMapper, - String? errorMessage,
- String? helpText,
- SelectionType selectionType = SelectionType.multiSelect,
- List<
DropdownItem> selectedOptions = const [], - OnOptionSelect<
int> ? onOptionSelected, - ChipConfig chipConfig = const ChipConfig(),
- FocusNode? focusNode,
- MultiSelectController<
int> ? controller, - String clearAllText = 'Clear All',
- TreeSelectionType treeSelectionType = TreeSelectionType.singleSelect,
- List<
TreeNode> treeOptions = const [], - List<
TreeNode> selectedTreeOptions = const [], - OnOptionSelected<
List< ? onTreeOptionSelected,TreeNode> > - Decoration? treeInputDecoration,
Implementation
const Dropdown({
Key? key,
this.dropdownType = Type.singleSelect,
this.dropdownSubtype = DropdownSubtype.defaultSelect,
this.textEditingController,
this.onChange,
this.items = const [],
this.options = const [],
this.textIcon,
this.readOnly = false,
this.suffixIcon = Icons.arrow_drop_down,
this.emptyItemText = "No Options available",
this.isSearchable = true,
this.selectedOption,
this.isDisabled = false,
this.valueMapper,
this.errorMessage,
this.helpText,
// MultiSelectDropDown props
this.selectionType = SelectionType.multiSelect,
this.selectedOptions = const [],
this.onOptionSelected,
this.chipConfig = const ChipConfig(),
this.focusNode,
this.controller,
this.clearAllText = 'Clear All',
// TreeSelectDropDown props
this.treeSelectionType = TreeSelectionType.singleSelect,
this.treeOptions = const [],
this.selectedTreeOptions = const [],
this.onTreeOptionSelected,
this.treeInputDecoration,
}) : super(key: key);