DfDropdownWrapper<T> constructor

const DfDropdownWrapper<T>({
  1. Key? key,
  2. List<DropDownModel<T>> initData = const [],
  3. DropDownModel<T>? selectedValue,
  4. String? labelText,
  5. dynamic onOptionSelected(
    1. DropDownModel<T>?
    )?,
  6. String? validator(
    1. DropDownModel<T>?
    )?,
  7. DropdownDecoration? decoration,
  8. Widget? arrowWidget,
  9. bool disabled = false,
  10. Future<List<DropDownModel<T>>>? asyncInitData,
  11. SimpleSelectorDecoration? selectorDecoration,
  12. Widget? child,
  13. bool closeOnTapOutside = true,
})

Constructor for DfDropdownWrapper.

  • selectorDecoration: Additional custom styling for the dropdown selector.
  • child: Custom widget to be displayed in the dropdown field.
  • closeOnTapOutside: Whether to close the dropdown when the user taps outside the dropdown.

Implementation

const DfDropdownWrapper({
  super.key,
  super.initData = const [],
  super.selectedValue,
  super.labelText,
  super.onOptionSelected,
  super.validator,
  super.decoration,
  super.arrowWidget,
  super.disabled = false,
  super.asyncInitData,
  this.selectorDecoration,
  this.child,
  super.closeOnTapOutside,
}) : assert(initData.length == 0 || asyncInitData == null,
          "initData and asyncInitData cannot be provided at the same time");