FormeFluentAutoSuggestBox<T extends Object> constructor

FormeFluentAutoSuggestBox<T extends Object>({
  1. Key? key,
  2. String? name,
  3. T? initialValue,
  4. FormeAsyncValidator<T?>? asyncValidator,
  5. Duration? asyncValidatorDebounce,
  6. AutovalidateMode? autovalidateMode,
  7. FormeFieldDecorator<T?>? decorator = const FormeFluentFormRowDecorator(padding: EdgeInsets.zero),
  8. bool enabled = true,
  9. FocusNode? focusNode,
  10. FormeFieldInitialized<T?>? onInitialized,
  11. FormeFieldSetter<T?>? onSaved,
  12. FormeFieldStatusChanged<T?>? onStatusChanged,
  13. int? order,
  14. bool quietlyValidate = false,
  15. bool readOnly = false,
  16. bool requestFocusOnUserInteraction = true,
  17. FormeFieldValidationFilter<T?>? validationFilter,
  18. FormeValidator<T?>? validator,
  19. bool autofocus = false,
  20. bool clearButtonEnabled = true,
  21. TextEditingController? controller,
  22. Color? cursorColor,
  23. double? cursorHeight,
  24. Radius cursorRadius = const Radius.circular(2.0),
  25. double cursorWidth = 1.5,
  26. BoxDecoration? decoration,
  27. bool enableKeyboardControls = true,
  28. BoxDecoration? foregroundDecoration,
  29. Color? highlightColor,
  30. List<TextInputFormatter>? inputFormatters,
  31. required List<AutoSuggestBoxItem<T>> items,
  32. Brightness? keyboardAppearance,
  33. Widget? leadingIcon,
  34. double maxPopupHeight = kAutoSuggestBoxPopupMaxHeight,
  35. WidgetBuilder? noResultsFoundBuilder,
  36. OnChangeAutoSuggestBox? onChanged,
  37. String? placeholder,
  38. TextStyle? placeholderStyle,
  39. EdgeInsets scrollPadding = const EdgeInsets.all(20.0),
  40. BoxHeightStyle selectionHeightStyle = BoxHeightStyle.tight,
  41. BoxWidthStyle selectionWidthStyle = BoxWidthStyle.tight,
  42. bool? showCursor,
  43. AutoSuggestBoxSorter<T>? sorter,
  44. TextStyle? style,
  45. TextInputAction? textInputAction,
  46. Widget? trailingIcon,
  47. Color? unfocusedColor,
})

Implementation

FormeFluentAutoSuggestBox({
  super.key,
  super.name,
  super.initialValue,
  super.asyncValidator,
  super.asyncValidatorDebounce,
  super.autovalidateMode,
  super.decorator = const FormeFluentFormRowDecorator(
    padding: EdgeInsets.zero,
  ),
  super.enabled = true,
  super.focusNode,
  super.onInitialized,
  super.onSaved,
  super.onStatusChanged,
  super.order,
  super.quietlyValidate = false,
  super.readOnly = false,
  super.requestFocusOnUserInteraction = true,
  super.validationFilter,
  super.validator,
  this.autofocus = false,
  this.clearButtonEnabled = true,
  this.controller,
  this.cursorColor,
  this.cursorHeight,
  this.cursorRadius = const Radius.circular(2.0),
  this.cursorWidth = 1.5,
  this.decoration,
  this.enableKeyboardControls = true,
  this.foregroundDecoration,
  this.highlightColor,
  this.inputFormatters,
  required this.items,
  this.keyboardAppearance,
  this.leadingIcon,
  this.maxPopupHeight = kAutoSuggestBoxPopupMaxHeight,
  this.noResultsFoundBuilder,
  this.onChanged,
  this.placeholder,
  this.placeholderStyle,
  this.scrollPadding = const EdgeInsets.all(20.0),
  this.selectionHeightStyle = BoxHeightStyle.tight,
  this.selectionWidthStyle = BoxWidthStyle.tight,
  this.showCursor,
  this.sorter,
  this.style,
  this.textInputAction,
  this.trailingIcon,
  this.unfocusedColor,
}) : super.allFields(
        builder: (state) {
          return AutoSuggestBox<T>(
            items: items,
            controller: controller,
            onChanged: onChanged,
            noResultsFoundBuilder: noResultsFoundBuilder,
            sorter: sorter,
            leadingIcon: leadingIcon,
            trailingIcon: trailingIcon,
            clearButtonEnabled: clearButtonEnabled,
            placeholder: placeholder,
            placeholderStyle: placeholderStyle,
            style: style,
            decoration: decoration,
            foregroundDecoration: foregroundDecoration,
            highlightColor: highlightColor,
            unfocusedColor: unfocusedColor,
            cursorColor: cursorColor,
            cursorHeight: cursorHeight,
            cursorRadius: cursorRadius,
            cursorWidth: cursorWidth,
            showCursor: showCursor,
            keyboardAppearance: keyboardAppearance,
            scrollPadding: scrollPadding,
            selectionHeightStyle: selectionHeightStyle,
            selectionWidthStyle: selectionWidthStyle,
            textInputAction: textInputAction,
            focusNode: state.focusNode,
            autofocus: autofocus,
            enableKeyboardControls: enableKeyboardControls,
            enabled: state.enabled,
            inputFormatters: inputFormatters,
            maxPopupHeight: maxPopupHeight,
            onSelected: state.readOnly
                ? null
                : (value) {
                    state.didChange(value.value);
                    state.requestFocusOnUserInteraction();
                  },
          );
        },
      );