Dropdown.singleSelection constructor

const Dropdown.singleSelection({
  1. Key? key,
  2. required List<DropdownItem> list,
  3. required dynamic onSingleItemListener(
    1. DropdownItem selectedItem
    )?,
  4. String? selectedId,
  5. String title = "",
  6. String labelText = "",
  7. String hintText = "",
  8. bool enabled = true,
  9. double? width,
  10. double? height,
  11. TextAlign textAlign = TextAlign.start,
  12. String? fontFamily,
  13. InputBorder border = const OutlineInputBorder(),
  14. InputDecoration? decoration,
  15. bool searchBox = true,
  16. String searchBoxHintText = _searchHere,
  17. IconData prefixSearchBoxIcon = _icSearch,
  18. Color? dialogBackgroundColor,
  19. Color itemBackgroundColor = Colors.transparent,
  20. Color selectedItemBackgroundColor = Colors.black12,
  21. String negativeButtonText = _cancel,
  22. Color negativeButtonTextColor = Colors.red,
  23. bool isAddItem = false,
  24. bool dismissWhenTapAddItem = true,
  25. dynamic onTapAddItem(
    1. String searchValue
    )?,
  26. Widget? addItemWidget,
  27. 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;