FormeFluentAutoSuggestBox<T extends Object> constructor
FormeFluentAutoSuggestBox<T extends Object> ({
- Key? key,
- String? name,
- T? initialValue,
- FormeAsyncValidator<
T?> ? asyncValidator, - Duration? asyncValidatorDebounce,
- AutovalidateMode? autovalidateMode,
- FormeFieldDecorator<
T?> ? decorator = const FormeFluentFormRowDecorator(padding: EdgeInsets.zero), - bool enabled = true,
- FocusNode? focusNode,
- FormeFieldInitialized<
T?> ? onInitialized, - FormeFieldSetter<
T?> ? onSaved, - FormeFieldStatusChanged<
T?> ? onStatusChanged, - int? order,
- bool quietlyValidate = false,
- bool readOnly = false,
- bool requestFocusOnUserInteraction = true,
- FormeFieldValidationFilter<
T?> ? validationFilter, - FormeValidator<
T?> ? validator, - bool autofocus = false,
- bool clearButtonEnabled = true,
- TextEditingController? controller,
- Color? cursorColor,
- double? cursorHeight,
- Radius cursorRadius = const Radius.circular(2.0),
- double cursorWidth = 1.5,
- BoxDecoration? decoration,
- bool enableKeyboardControls = true,
- BoxDecoration? foregroundDecoration,
- Color? highlightColor,
- List<
TextInputFormatter> ? inputFormatters, - required List<
AutoSuggestBoxItem< items,T> > - Brightness? keyboardAppearance,
- Widget? leadingIcon,
- double maxPopupHeight = kAutoSuggestBoxPopupMaxHeight,
- WidgetBuilder? noResultsFoundBuilder,
- OnChangeAutoSuggestBox? onChanged,
- String? placeholder,
- TextStyle? placeholderStyle,
- EdgeInsets scrollPadding = const EdgeInsets.all(20.0),
- BoxHeightStyle selectionHeightStyle = BoxHeightStyle.tight,
- BoxWidthStyle selectionWidthStyle = BoxWidthStyle.tight,
- bool? showCursor,
- AutoSuggestBoxSorter<
T> ? sorter, - TextStyle? style,
- TextInputAction? textInputAction,
- Widget? trailingIcon,
- 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();
},
);
},
);