FSelect<T>.searchBuilder constructor

const FSelect<T>.searchBuilder({
  1. required String format(
    1. T value
    ),
  2. required FutureOr<Iterable<T>> filter(
    1. String query
    ),
  3. required FSelectSearchContentBuilder<T> contentBuilder,
  4. FSelectSearchFieldProperties searchFieldProperties,
  5. Widget contentLoadingBuilder(
    1. BuildContext context,
    2. FSelectSearchStyle style
    ),
  6. Widget contentErrorBuilder(
    1. BuildContext context,
    2. Object? error,
    3. StackTrace stackTrace
    )?,
  7. FSelectController<T>? controller,
  8. FSelectStyle style(
    1. FSelectStyle style
    )?,
  9. bool autofocus,
  10. FocusNode? focusNode,
  11. FFieldBuilder<FSelectStyle> builder,
  12. FFieldIconBuilder<FSelectStyle>? prefixBuilder,
  13. FFieldIconBuilder<FSelectStyle>? suffixBuilder,
  14. Widget? label,
  15. Widget? description,
  16. bool enabled,
  17. ValueChanged<T?>? onChange,
  18. FormFieldSetter<T>? onSaved,
  19. VoidCallback? onReset,
  20. AutovalidateMode autovalidateMode,
  21. String? forceErrorText,
  22. FormFieldValidator<T> validator,
  23. Widget errorBuilder(
    1. BuildContext context,
    2. String message
    ),
  24. String? hint,
  25. TextAlign textAlign,
  26. TextAlignVertical? textAlignVertical,
  27. TextDirection? textDirection,
  28. bool expands,
  29. MouseCursor mouseCursor,
  30. bool canRequestFocus,
  31. bool clearable,
  32. AlignmentGeometry anchor,
  33. AlignmentGeometry fieldAnchor,
  34. FPortalConstraints popoverConstraints,
  35. FPortalSpacing spacing,
  36. Offset shift(
    1. Size size,
    2. FPortalChildBox childBox,
    3. FPortalBox portalBox
    ),
  37. Offset offset,
  38. FPopoverHideRegion hideRegion,
  39. bool autoHide,
  40. Widget contentEmptyBuilder(
    1. BuildContext context,
    2. FSelectStyle style
    ),
  41. ScrollController? contentScrollController,
  42. bool contentScrollHandles,
  43. ScrollPhysics contentPhysics,
  44. FItemDivider contentDivider,
  45. T? initialValue,
  46. 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>;