MultiSelectDropDown<T>.network constructor

const MultiSelectDropDown<T>.network({
  1. Key? key,
  2. required OnOptionSelected<T>? onOptionSelected,
  3. required NetworkConfig? networkConfig,
  4. required Future<List<ValueItem<T>>> responseParser(
    1. dynamic
    )?,
  5. void onOptionRemoved(
    1. int index,
    2. ValueItem<T> option
    )?,
  6. Widget responseErrorBuilder(
    1. BuildContext,
    2. dynamic
    )?,
  7. Color? selectedOptionTextColor,
  8. ChipConfig chipConfig = const ChipConfig(),
  9. SelectionType selectionType = SelectionType.multi,
  10. String hint = 'Select',
  11. Color? hintColor = Colors.grey,
  12. double? hintFontSize = 14.0,
  13. List<ValueItem<T>> selectedOptions = const [],
  14. List<ValueItem<T>> disabledOptions = const [],
  15. bool alwaysShowOptionIcon = false,
  16. TextStyle? optionTextStyle,
  17. Icon? selectedOptionIcon = const Icon(Icons.check),
  18. Color? selectedOptionBackgroundColor,
  19. Color? optionsBackgroundColor,
  20. Color? fieldBackgroundColor = Colors.white,
  21. double dropdownHeight = 200,
  22. bool showChipInSingleSelectMode = false,
  23. Icon? suffixIcon = const Icon(Icons.arrow_drop_down),
  24. Icon? clearIcon = const Icon(Icons.close_outlined, size: 14),
  25. Widget selectedItemBuilder(
    1. BuildContext,
    2. ValueItem<T>
    )?,
  26. Widget? optionSeparator,
  27. Decoration? inputDecoration,
  28. TextStyle? hintStyle,
  29. EdgeInsets? padding,
  30. Color? borderColor = Colors.grey,
  31. Color? focusedBorderColor = Colors.black54,
  32. double? borderWidth = 0.4,
  33. double? focusedBorderWidth = 0.4,
  34. double? borderRadius = 12.0,
  35. BorderRadiusGeometry? radiusGeometry,
  36. bool showClearIcon = true,
  37. int? maxItems,
  38. FocusNode? focusNode,
  39. MultiSelectController<T>? controller,
  40. bool searchEnabled = false,
  41. double? dropdownBorderRadius,
  42. double? dropdownMargin,
  43. Color? dropdownBackgroundColor,
  44. Color? searchBackgroundColor,
  45. String? searchLabel = 'Search',
})

Constructor for MultiSelectDropDown that fetches the options from a network call. networkConfig is the configuration for the network call. responseParser is the parser that is used to parse the response from the network call. responseErrorBuilder is the builder that is used to build the error widget when the network call fails.

Implementation

const MultiSelectDropDown.network(
    {Key? key,
    required this.onOptionSelected,
    required this.networkConfig,
    required this.responseParser,
    this.onOptionRemoved,
    this.responseErrorBuilder,
    this.selectedOptionTextColor,
    this.chipConfig = const ChipConfig(),
    this.selectionType = SelectionType.multi,
    this.hint = 'Select',
    this.hintColor = Colors.grey,
    this.hintFontSize = 14.0,
    this.selectedOptions = const [],
    this.disabledOptions = const [],
    this.alwaysShowOptionIcon = false,
    this.optionTextStyle,
    this.selectedOptionIcon = const Icon(Icons.check),
    this.selectedOptionBackgroundColor,
    this.optionsBackgroundColor,
    this.fieldBackgroundColor = Colors.white,
    this.dropdownHeight = 200,
    this.showChipInSingleSelectMode = false,
    this.suffixIcon = const Icon(Icons.arrow_drop_down),
    this.clearIcon = const Icon(Icons.close_outlined, size: 14),
    this.selectedItemBuilder,
    this.optionSeparator,
    this.inputDecoration,
    this.hintStyle,
    this.padding,
    this.borderColor = Colors.grey,
    this.focusedBorderColor = Colors.black54,
    this.borderWidth = 0.4,
    this.focusedBorderWidth = 0.4,
    this.borderRadius = 12.0,
    this.radiusGeometry,
    this.showClearIcon = true,
    this.maxItems,
    this.focusNode,
    this.controller,
    this.searchEnabled = false,
    this.dropdownBorderRadius,
    this.dropdownMargin,
    this.dropdownBackgroundColor,
    this.searchBackgroundColor,
    this.searchLabel = 'Search'})
    : options = const [],
      super(key: key);