FSelect<T>.searchBuilder constructor
const
FSelect<T>.searchBuilder ({
- required String format(
- T value
- required FutureOr<
Iterable< filter(T> >- String query
- required FSelectSearchContentBuilder<
T> contentBuilder, - FSelectSearchFieldProperties searchFieldProperties,
- Widget contentLoadingBuilder(
- BuildContext context,
- FSelectSearchStyle style
- Widget contentErrorBuilder(
- BuildContext context,
- Object? error,
- StackTrace stackTrace
- FSelectController<
T> ? controller, - FSelectStyle style(
- FSelectStyle style
- bool autofocus,
- FocusNode? focusNode,
- FFieldBuilder<
FSelectStyle> builder, - FFieldIconBuilder<
FSelectStyle> ? prefixBuilder, - FFieldIconBuilder<
FSelectStyle> ? suffixBuilder, - Widget? label,
- Widget? description,
- bool enabled,
- ValueChanged<
T?> ? onChange, - FormFieldSetter<
T> ? onSaved, - VoidCallback? onReset,
- AutovalidateMode autovalidateMode,
- String? forceErrorText,
- FormFieldValidator<
T> validator, - Widget errorBuilder(
- BuildContext context,
- String message
- String? hint,
- TextAlign textAlign,
- TextAlignVertical? textAlignVertical,
- TextDirection? textDirection,
- bool expands,
- MouseCursor mouseCursor,
- bool canRequestFocus,
- bool clearable,
- AlignmentGeometry anchor,
- AlignmentGeometry fieldAnchor,
- FPortalConstraints popoverConstraints,
- FPortalSpacing spacing,
- Offset shift(
- Size size,
- FPortalChildBox childBox,
- FPortalBox portalBox
- Offset offset,
- FPopoverHideRegion hideRegion,
- bool autoHide,
- Widget contentEmptyBuilder(
- BuildContext context,
- FSelectStyle style
- ScrollController? contentScrollController,
- bool contentScrollHandles,
- ScrollPhysics contentPhysics,
- FItemDivider contentDivider,
- T? initialValue,
- Key? key,
Creates a searchable select with dynamic content based on search input.
The searchFieldProperties
can be used to customize the search field.
The filter
callback produces a list of items based on the search query either synchronously or asynchronously.
The contentBuilder
callback builds the list of items based on search results returned by filter
.
The contentLoadingBuilder
is used to show a loading indicator while the search results is processed
asynchronously by filter
.
The contentErrorBuilder
is used to show an error message when filter
is asynchronous and fails.
Implementation
const factory FSelect.searchBuilder({
required String Function(T value) format,
required FutureOr<Iterable<T>> Function(String query) filter,
required FSelectSearchContentBuilder<T> contentBuilder,
FSelectSearchFieldProperties searchFieldProperties,
Widget Function(BuildContext context, FSelectSearchStyle style) contentLoadingBuilder,
Widget Function(BuildContext context, Object? error, StackTrace stackTrace)? contentErrorBuilder,
FSelectController<T>? controller,
FSelectStyle Function(FSelectStyle style)? style,
bool autofocus,
FocusNode? focusNode,
FFieldBuilder<FSelectStyle> builder,
FFieldIconBuilder<FSelectStyle>? prefixBuilder,
FFieldIconBuilder<FSelectStyle>? suffixBuilder,
Widget? label,
Widget? description,
bool enabled,
ValueChanged<T?>? onChange,
FormFieldSetter<T>? onSaved,
VoidCallback? onReset,
AutovalidateMode autovalidateMode,
String? forceErrorText,
FormFieldValidator<T> validator,
Widget Function(BuildContext context, String message) errorBuilder,
String? hint,
TextAlign textAlign,
TextAlignVertical? textAlignVertical,
TextDirection? textDirection,
bool expands,
MouseCursor mouseCursor,
bool canRequestFocus,
bool clearable,
AlignmentGeometry anchor,
AlignmentGeometry fieldAnchor,
FPortalConstraints popoverConstraints,
FPortalSpacing spacing,
Offset Function(Size size, FPortalChildBox childBox, FPortalBox portalBox) shift,
Offset offset,
FPopoverHideRegion hideRegion,
bool autoHide,
Widget Function(BuildContext context, FSelectStyle style) contentEmptyBuilder,
ScrollController? contentScrollController,
bool contentScrollHandles,
ScrollPhysics contentPhysics,
FItemDivider contentDivider,
T? initialValue,
Key? key,
}) = _SearchSelect<T>;