MultiSelectDropDown.network constructor

const MultiSelectDropDown.network({
  1. Key? key,
  2. required NetworkConfig? networkConfig,
  3. required Future<List<ValueItem>> responseParser(
    1. dynamic
    )?,
  4. Widget responseErrorBuilder(
    1. BuildContext,
    2. dynamic
    )?,
  5. required OnOptionSelected? onOptionSelected,
  6. Color? selectedOptionTextColor,
  7. Widget? optionSeperator,
  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> selectedOptions = const [],
  14. List<ValueItem> disabledOptions = const [],
  15. bool alwaysShowOptionIcon = false,
  16. TextStyle? optionTextStyle,
  17. Icon? selectedOptionIcon = const Icon(Icons.check),
  18. Color? selectedOptionBackgroundColor,
  19. Color? optionsBackgroundColor,
  20. Color? backgroundColor = Colors.white,
  21. double dropdownHeight = 200,
  22. bool showChipInSingleSelectMode = false,
  23. IconData? suffixIcon = Icons.arrow_drop_down,
  24. Widget selectedItemBuilder(
    1. BuildContext,
    2. ValueItem
    )?,
  25. Widget? optionSeparator,
  26. Decoration? inputDecoration,
  27. TextStyle? hintStyle,
  28. EdgeInsets? padding = const EdgeInsets.symmetric(horizontal: 8, vertical: 8),
  29. Color? borderColor = Colors.grey,
  30. double? borderWidth = 0.4,
  31. double? borderRadius = 12.0,
  32. BorderRadiusGeometry? radiusGeometry,
  33. bool showClearIcon = true,
})

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.networkConfig,
    required this.responseParser,
    this.responseErrorBuilder,
    required this.onOptionSelected,
    this.selectedOptionTextColor,
    this.optionSeperator,
    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.backgroundColor = Colors.white,
    this.dropdownHeight = 200,
    this.showChipInSingleSelectMode = false,
    this.suffixIcon = Icons.arrow_drop_down,
    this.selectedItemBuilder,
    this.optionSeparator,
    this.inputDecoration,
    this.hintStyle,
    this.padding = const EdgeInsets.symmetric(
      horizontal: 8,
      vertical: 8,
    ),
    this.borderColor = Colors.grey,
    this.borderWidth = 0.4,
    this.borderRadius = 12.0,
    this.radiusGeometry,
    this.showClearIcon = true})
    : options = const [],
      super(key: key);