MultiSelectDropDown<T>.network constructor
const
MultiSelectDropDown<T>.network ({
- Key? key,
- required OnOptionSelected<
T> ? onOptionSelected, - required NetworkConfig? networkConfig,
- required Future<
List< responseParser(ValueItem< >T> >- dynamic
- void onOptionRemoved()?,
- Widget responseErrorBuilder(
- BuildContext,
- dynamic
- Color? selectedOptionTextColor,
- ChipConfig chipConfig = const ChipConfig(),
- SelectionType selectionType = SelectionType.multi,
- String hint = 'Select',
- Color? hintColor = Colors.grey,
- double? hintFontSize = 14.0,
- List<
ValueItem< selectedOptions = const [],T> > - List<
ValueItem< disabledOptions = const [],T> > - bool alwaysShowOptionIcon = false,
- TextStyle? optionTextStyle,
- Icon? selectedOptionIcon = const Icon(Icons.check),
- Color? selectedOptionBackgroundColor,
- Color? optionsBackgroundColor,
- Color? fieldBackgroundColor = Colors.white,
- double dropdownHeight = 200,
- bool showChipInSingleSelectMode = false,
- Icon suffixIcon = const Icon(Icons.arrow_drop_down),
- Icon? clearIcon = const Icon(Icons.close_outlined, size: 14),
- Widget selectedItemBuilder()?,
- Widget? optionSeparator,
- Decoration? inputDecoration,
- TextStyle? hintStyle,
- EdgeInsetsGeometry? hintPadding = HintText.hintPaddingDefault,
- EdgeInsets? padding,
- Color? borderColor = Colors.grey,
- Color? focusedBorderColor = Colors.black54,
- double? borderWidth = 0.4,
- double? focusedBorderWidth = 0.4,
- double? borderRadius = 12.0,
- BorderRadiusGeometry? radiusGeometry,
- int? maxItems,
- FocusNode? focusNode,
- MultiSelectController<
T> ? controller, - bool searchEnabled = false,
- double? dropdownBorderRadius,
- double? dropdownMargin,
- Color? dropdownBackgroundColor,
- Color? searchBackgroundColor,
- bool animateSuffixIcon = true,
- TextStyle? singleSelectItemStyle,
- Widget optionBuilder(
- BuildContext ctx,
- ValueItem<
T> item, - bool selected
- 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.hintPadding = HintText.hintPaddingDefault,
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.maxItems,
this.focusNode,
this.controller,
this.searchEnabled = false,
this.dropdownBorderRadius,
this.dropdownMargin,
this.dropdownBackgroundColor,
this.searchBackgroundColor,
this.animateSuffixIcon = true,
this.singleSelectItemStyle,
this.optionBuilder,
this.searchLabel = 'Search'})
: options = const [],
super(key: key);