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. TextAlign textAlign = TextAlign.start,
  10. InputBorder border = const OutlineInputBorder(),
  11. InputDecoration? decoration,
  12. bool searchBox = true,
  13. String searchBoxHintText = _searchHere,
  14. IconData prefixSearchBoxIcon = _icSearch,
  15. Color selectedBackgroundColor = Colors.black12,
  16. String negativeButtonText = _cancel,
  17. Color negativeButtonTextColor = Colors.red,
  18. bool isAddItem = false,
  19. bool dismissWhenTapAddItem = true,
  20. dynamic onTapAddItem(
    1. String searchValue
    )?,
  21. Widget? addItemWidget,
})

constructor for single selection dropdown

Implementation

const Dropdown.singleSelection(
    {Key? key,
    required this.list,
    required this.onSingleItemListener,
    this.selectedId,
    this.title = "",
    this.labelText = "",
    this.hintText = "",
    this.enabled = true,
    this.textAlign = TextAlign.start,
    this.border = const OutlineInputBorder(),
    this.decoration,
    this.searchBox = true,
    this.searchBoxHintText = _searchHere,
    this.prefixSearchBoxIcon = _icSearch,
    this.selectedBackgroundColor = Colors.black12,
    this.negativeButtonText = _cancel,
    this.negativeButtonTextColor = Colors.red,
    this.isAddItem = false,
    this.dismissWhenTapAddItem = true,
    this.onTapAddItem,
    this.addItemWidget})
    : selectedIds = null,
      prefixSeparator = _has,
      suffixSeparator = _comma,
      positiveButtonText = _ok,
      positiveButtonTextColor = Colors.black,
      isAllSelection = false,
      checkBoxActiveColor = Colors.black,
      onMultipleItemListener = null,
      _isMultiple = false,
      super(key: key);