Dropdown.singleSelection constructor
const
Dropdown.singleSelection({
- Key? key,
- required List<
DropdownItem> list, - required dynamic onSingleItemListener(
- DropdownItem selectedItem
- String? selectedId,
- String title = "",
- String labelText = "",
- String hintText = "",
- bool enabled = true,
- double? width,
- double? height,
- TextAlign textAlign = TextAlign.start,
- String? fontFamily,
- InputBorder border = const OutlineInputBorder(),
- InputDecoration? decoration,
- bool searchBox = true,
- String searchBoxHintText = _searchHere,
- IconData prefixSearchBoxIcon = _icSearch,
- Color? dialogBackgroundColor,
- Color itemBackgroundColor = Colors.transparent,
- Color selectedItemBackgroundColor = Colors.black12,
- String negativeButtonText = _cancel,
- Color negativeButtonTextColor = Colors.red,
- bool isAddItem = false,
- bool dismissWhenTapAddItem = true,
- dynamic onTapAddItem(
- String searchValue
- Widget? addItemWidget,
- Widget? noDataWidget,
constructor for single selection dropdown
Implementation
const Dropdown.singleSelection(
{super.key,
required this.list,
required this.onSingleItemListener,
this.selectedId,
this.title = "",
this.labelText = "",
this.hintText = "",
this.enabled = true,
this.width,
this.height,
this.textAlign = TextAlign.start,
this.fontFamily,
this.border = const OutlineInputBorder(),
this.decoration,
this.searchBox = true,
this.searchBoxHintText = _searchHere,
this.prefixSearchBoxIcon = _icSearch,
this.dialogBackgroundColor,
this.itemBackgroundColor = Colors.transparent,
this.selectedItemBackgroundColor = Colors.black12,
this.negativeButtonText = _cancel,
this.negativeButtonTextColor = Colors.red,
this.isAddItem = false,
this.dismissWhenTapAddItem = true,
this.onTapAddItem,
this.addItemWidget,
this.noDataWidget})
: selectedIds = null,
prefixSeparator = _has,
suffixSeparator = _comma,
positiveButtonText = _ok,
positiveButtonTextColor = Colors.black,
isAllSelection = false,
checkBoxActiveColor = Colors.black,
onMultipleItemListener = null,
_isMultiple = false;