FluentAutoSuggestBox<T>.form constructor
FluentAutoSuggestBox<T>.form ({
- Key? key,
- required List<
FluentAutoSuggestBoxItem< items,T> > - TextEditingController? controller,
- AutoSuggestController<
T> ? autoSuggestController, - OnTextChanged<
T> ? onChanged, - ValueChanged<
FluentAutoSuggestBoxItem< ? onSelected,T> ?> - ValueChanged<
bool> ? onOverlayVisibilityChanged, - ItemBuilder<
T> ? itemBuilder, - WidgetBuilder? noResultsFoundBuilder,
- WidgetBuilder? loadingBuilder,
- ItemSorter<
T> ? sorter, - Widget? trailingIcon,
- bool clearButtonEnabled = true,
- TextStyle? style,
- InputDecoration? decoration,
- Color? cursorColor,
- double? cursorHeight,
- Radius cursorRadius = const Radius.circular(2.0),
- double cursorWidth = 1.5,
- bool? showCursor,
- Brightness? keyboardAppearance,
- EdgeInsets scrollPadding = const EdgeInsets.all(20.0),
- BoxHeightStyle selectionHeightStyle = ui.BoxHeightStyle.tight,
- BoxWidthStyle selectionWidthStyle = ui.BoxWidthStyle.tight,
- FormFieldValidator<
String> ? validator, - AutovalidateMode autovalidateMode = AutovalidateMode.disabled,
- TextInputAction? textInputAction,
- FocusNode? focusNode,
- bool autofocus = false,
- bool enableKeyboardControls = true,
- bool enabled = true,
- bool readOnly = false,
- List<
TextInputFormatter> ? inputFormatters, - double maxPopupHeight = kDefaultMaxPopupHeight,
- Future<
List< onNoResultsFound()?,FluentAutoSuggestBoxItem< >T> > - void onError(
- Object error,
- StackTrace stack
- double tileHeight = kDefaultItemHeight,
- AutoSuggestBoxDirection direction = AutoSuggestBoxDirection.below,
- TextInputType keyboardType = TextInputType.text,
- int? maxLength,
- Offset? offset,
- VoidCallback? onEditingComplete,
- bool enableCache = true,
- int cacheMaxSize = 100,
- Duration cacheDuration = const Duration(minutes: 30),
- Duration debounceDelay = const Duration(milliseconds: 300),
- int minSearchLength = 2,
Creates a fluent-styled auto suggest form box
Implementation
FluentAutoSuggestBox.form({
super.key,
required List<FluentAutoSuggestBoxItem<T>> items,
this.controller,
this.autoSuggestController,
this.onChanged,
this.onSelected,
this.onOverlayVisibilityChanged,
this.itemBuilder,
this.noResultsFoundBuilder,
this.loadingBuilder,
this.sorter,
this.trailingIcon,
this.clearButtonEnabled = true,
this.style,
this.decoration,
this.cursorColor,
this.cursorHeight,
this.cursorRadius = const Radius.circular(2.0),
this.cursorWidth = 1.5,
this.showCursor,
this.keyboardAppearance,
this.scrollPadding = const EdgeInsets.all(20.0),
this.selectionHeightStyle = ui.BoxHeightStyle.tight,
this.selectionWidthStyle = ui.BoxWidthStyle.tight,
this.validator,
this.autovalidateMode = AutovalidateMode.disabled,
this.textInputAction,
this.focusNode,
this.autofocus = false,
this.enableKeyboardControls = true,
this.enabled = true,
this.readOnly = false,
this.inputFormatters,
this.maxPopupHeight = kDefaultMaxPopupHeight,
this.onNoResultsFound,
this.onError,
this.tileHeight = kDefaultItemHeight,
this.direction = AutoSuggestBoxDirection.below,
this.keyboardType = TextInputType.text,
this.maxLength,
this.offset,
this.onEditingComplete,
this.enableCache = true,
this.cacheMaxSize = 100,
this.cacheDuration = const Duration(minutes: 30),
this.debounceDelay = const Duration(milliseconds: 300),
this.minSearchLength = 2,
}) : items = ValueNotifier(items.toSet()),
cubit = null,
cubitItemBuilder = null,
labelBuilder = null,
onCubitSelected = null,
cubitFilters = null,
showCubitStats = false,
cubitLoadingBuilder = null,
cubitErrorBuilder = null,
cubitEmptyBuilder = null;