AutoSuggestBox<T> constructor
const
AutoSuggestBox<T> ({
- Key? key,
- required List<
AutoSuggestBoxItem< items,T> > - TextEditingController? controller,
- OnChangeAutoSuggestBox? onChanged,
- ValueChanged<
AutoSuggestBoxItem< ? onSelected,T> > - ValueChanged<
bool> ? onOverlayVisibilityChanged, - AutoSuggestBoxItemBuilder? itemBuilder,
- WidgetBuilder? noResultsFoundBuilder,
- AutoSuggestBoxSorter<
T> ? sorter, - Widget? leadingIcon,
- Widget? trailingIcon,
- bool clearButtonEnabled = true,
- String? placeholder,
- TextStyle? placeholderStyle,
- TextStyle? style,
- BoxDecoration? decoration,
- BoxDecoration? foregroundDecoration,
- Color? highlightColor,
- Color? unfocusedColor,
- 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,
- TextInputAction? textInputAction,
- FocusNode? focusNode,
- bool autofocus = false,
- bool enableKeyboardControls = true,
- bool enabled = true,
- List<
TextInputFormatter> ? inputFormatters, - double maxPopupHeight = kAutoSuggestBoxPopupMaxHeight,
Creates a fluent-styled auto suggest box.
Implementation
const AutoSuggestBox({
super.key,
required this.items,
this.controller,
this.onChanged,
this.onSelected,
this.onOverlayVisibilityChanged,
this.itemBuilder,
this.noResultsFoundBuilder,
this.sorter,
this.leadingIcon,
this.trailingIcon,
this.clearButtonEnabled = true,
this.placeholder,
this.placeholderStyle,
this.style,
this.decoration,
this.foregroundDecoration,
this.highlightColor,
this.unfocusedColor,
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.textInputAction,
this.focusNode,
this.autofocus = false,
this.enableKeyboardControls = true,
this.enabled = true,
this.inputFormatters,
this.maxPopupHeight = kAutoSuggestBoxPopupMaxHeight,
}) : autovalidateMode = AutovalidateMode.disabled,
validator = null;