BaseSearchField<T extends Object> constructor
const
BaseSearchField<T extends Object> ({
- required String? labelText,
- required FutureOr<
Iterable< optionsBuilder(),T> > - required Widget item(
- T element
- required void onChanged(
- String text
- required void onSelected(
- T
- required String getItemText(
- T value
- ButtonStyle? itemStyle,
- List<
T> ? unenabledList = const [], - EdgeInsets listPadding = const EdgeInsets.symmetric(vertical: 16),
- double? itemsSpace,
- Clip listClipBehavior = Clip.hardEdge,
- Icon fieldActiveIcon = const Icon(Icons.close),
- Icon fieldInactiveIcon = const Icon(Icons.arrow_drop_down),
- Key? textFieldKey,
- bool? isRequired,
- String displayStringForOption(
- T value
- Key? key,
- bool? showErrorText,
- String? errorText,
- TextEditingController? controller,
- FocusNode? focusNode,
- Icon? unfocusSuffixIcon,
- double? suffixIconPadding,
- int? errorMaxLines,
- String? description,
- TextStyle? textStyle,
- Widget? fieldSuffixIcon,
- Widget customTextField({
- required TextEditingController controller,
- required FocusNode focusNode,
- required GlobalKey<
State< key,StatefulWidget> > - required void onChanged()?,
- required void onSubmitted()?,
- required Widget suffixIcon,
- required Key? textFieldKey,
- Widget listButtonItem({})?,
- InputDecoration? fieldDecoration,
- bool useFindChildIndexCallback = true,
- bool usePrototype = true,
- List<
TextInputFormatter> ? fieldInputFormatters, - TextStyle? labelTextStyle,
- OptionsViewOpenDirection optionsViewOpenDirection = OptionsViewOpenDirection.down,
- TextEditingValue? initValue,
- void onFieldSubmitted()?,
- Key? listKey,
- Key? listItemKey,
- double? listCacheExtent,
- bool listAddSemanticIndexes = true,
- ScrollController? listController,
- String? listRestorationId,
- int? listSemanticChildCount,
- DragStartBehavior listDragStartBehavior = DragStartBehavior.start,
- ScrollPhysics? listPhysics,
- bool? listPrimary,
- Key? fieldIconKey,
Implementation
const BaseSearchField({
required this.labelText,
required this.optionsBuilder,
required this.item,
required this.onChanged,
required this.onSelected,
required this.getItemText,
this.itemStyle,
this.unenabledList = const [],
this.menuMaxHeight = 400,
this.menuMargin = const EdgeInsets.only(top: 4, bottom: 8),
this.listPadding = const EdgeInsets.symmetric(vertical: 16),
this.itemsSpace,
this.menuDecoration,
this.listClipBehavior = Clip.hardEdge,
this.fieldActiveIcon = const Icon(Icons.close),
this.fieldInactiveIcon = const Icon(Icons.arrow_drop_down),
this.textFieldKey,
this.isRequired,
this.displayStringForOption,
super.key,
this.showErrorText,
this.errorText,
this.controller,
this.focusNode,
this.unfocusSuffixIcon,
this.suffixIconPadding,
this.errorMaxLines,
this.description,
this.textStyle,
this.fieldSuffixIcon,
this.customTextField,
this.menuList,
this.listButtonItem,
this.fieldDecoration,
this.useFindChildIndexCallback = true,
this.usePrototype = true,
this.fieldInputFormatters,
this.labelTextStyle,
this.optionsViewOpenDirection = OptionsViewOpenDirection.down,
this.initValue,
this.onFieldSubmitted,
this.listKey,
this.listItemKey,
this.listCacheExtent,
this.listAddSemanticIndexes = true,
this.listController,
this.listRestorationId,
this.listSemanticChildCount,
this.listDragStartBehavior = DragStartBehavior.start,
this.listPhysics,
this.listPrimary,
this.fieldIconKey,
}) : assert(
!(item == null && listButtonItem == null),
'Either provide a [listItem] or a custom [listButtonItem].',
);