MultiSelectDropdownPlusFormField<C extends BlocBase<S>, S> constructor

MultiSelectDropdownPlusFormField<C extends BlocBase<S>, S>({
  1. required C cubit,
  2. required void onSearch(
    1. String query
    ),
  3. required void onStateChange(
    1. S state,
    2. void updateList(
      1. List<DropdownItem>
      ),
    3. void updateLoading(
      1. bool
      )
    ),
  4. required String hintText,
  5. Key? key,
  6. List<DropdownItem> initialValue = const [],
  7. FormFieldValidator<List<DropdownItem>>? validator,
  8. FormFieldSetter<List<DropdownItem>>? onSaved,
  9. AutovalidateMode? autovalidateMode,
  10. bool enabled = true,
  11. String? searchHint,
  12. String? noResultsText,
  13. String? loadingText,
  14. bool needInitialFetch = false,
  15. int maxDisplayChips = 2,
  16. DropdownPlusTheme? dropdownTheme,
  17. DropdownPlusThemeStyle? themeStyle,
  18. Widget itemBuilder(
    1. DropdownItem item,
    2. bool isSelected
    )?,
  19. Widget selectedItemBuilder(
    1. List<DropdownItem> selected
    )?,
  20. double? buttonHeight,
  21. double? buttonWidth,
  22. Future<bool> checkInternetConnection()?,
  23. Duration debounceDuration = Duration.zero,
  24. bool autofocusSearch = false,
  25. DropdownEmptyBuilder? emptyBuilder,
  26. DropdownLoadingBuilder? loadingBuilder,
  27. Object? error,
  28. VoidCallback? onRetry,
  29. DropdownErrorBuilder? errorBuilder,
  30. String? semanticsLabel,
  31. int minSearchLength = 0,
})

Implementation

MultiSelectDropdownPlusFormField({
  required C cubit,
  required void Function(String query) onSearch,
  required void Function(
    S state,
    void Function(List<DropdownItem<dynamic>>) updateList,
    void Function(bool) updateLoading,
  ) onStateChange,
  required String hintText,
  super.key,
  List<DropdownItem<dynamic>> initialValue = const [],
  super.validator,
  super.onSaved,
  super.autovalidateMode,
  super.enabled,
  String? searchHint,
  String? noResultsText,
  String? loadingText,
  bool needInitialFetch = false,
  int maxDisplayChips = 2,
  DropdownPlusTheme? dropdownTheme,
  DropdownPlusThemeStyle? themeStyle,
  Widget Function(DropdownItem<dynamic> item, bool isSelected)? itemBuilder,
  Widget Function(List<DropdownItem<dynamic>> selected)? selectedItemBuilder,
  double? buttonHeight,
  double? buttonWidth,
  Future<bool> Function()? checkInternetConnection,
  Duration debounceDuration = Duration.zero,
  bool autofocusSearch = false,
  DropdownEmptyBuilder? emptyBuilder,
  DropdownLoadingBuilder? loadingBuilder,
  Object? error,
  VoidCallback? onRetry,
  DropdownErrorBuilder? errorBuilder,
  String? semanticsLabel,
  int minSearchLength = 0,
}) : super(
        initialValue: initialValue,
        builder: (state) {
          return dropdownFormFieldDecoration(
            state: state,
            dropdown: MultiSelectDropdownPlus<C, S>(
              cubit: cubit,
              onSearch: onSearch,
              onStateChange: onStateChange,
              hintText: hintText,
              selectedItems: state.value ?? const [],
              onSelectionChanged: (items) => state.didChange(items),
              searchHint: searchHint,
              noResultsText: noResultsText,
              loadingText: loadingText,
              needInitialFetch: needInitialFetch,
              maxDisplayChips: maxDisplayChips,
              dropdownTheme: dropdownTheme,
              themeStyle: themeStyle,
              itemBuilder: itemBuilder,
              selectedItemBuilder: selectedItemBuilder,
              buttonHeight: buttonHeight,
              buttonWidth: buttonWidth,
              checkInternetConnection: checkInternetConnection,
              debounceDuration: debounceDuration,
              enabled: enabled,
              autofocusSearch: autofocusSearch,
              emptyBuilder: emptyBuilder,
              loadingBuilder: loadingBuilder,
              error: error,
              onRetry: onRetry,
              errorBuilder: errorBuilder,
              semanticsLabel: semanticsLabel,
              minSearchLength: minSearchLength,
            ),
          );
        },
      );