FAutocomplete<T>.builder constructor

const FAutocomplete<T>.builder({
  1. required FutureOr<Iterable<T>> filter(
    1. String text
    ),
  2. required String format(
    1. T suggestion
    ),
  3. required T? parse(
    1. String? text
    ),
  4. required FAutocompleteContentBuilder<T> contentBuilder,
  5. FAutocompleteControl control = const .managed(),
  6. FPopoverControl popoverControl = const .managed(),
  7. FTextFieldSizeVariant size = .md,
  8. FAutocompleteStyleDelta style = const .context(),
  9. Widget? label,
  10. String? hint,
  11. Widget? description,
  12. TextMagnifierConfiguration? magnifierConfiguration,
  13. Object groupId = EditableText,
  14. FocusNode? focusNode,
  15. TextInputType? keyboardType,
  16. TextInputAction? textInputAction,
  17. TextCapitalization textCapitalization = .none,
  18. TextAlign textAlign = .start,
  19. TextAlignVertical? textAlignVertical,
  20. TextDirection? textDirection,
  21. VoidCallback? contentOnTapHide,
  22. bool autofocus = false,
  23. String obscuringCharacter = '•',
  24. bool obscureText = false,
  25. bool autocorrect = true,
  26. SmartDashesType? smartDashesType,
  27. SmartQuotesType? smartQuotesType,
  28. bool enableSuggestions = true,
  29. int? minLines,
  30. int? maxLines = 1,
  31. bool expands = false,
  32. bool readOnly = false,
  33. bool? showCursor,
  34. int? maxLength,
  35. MaxLengthEnforcement? maxLengthEnforcement,
  36. bool onTapAlwaysCalled = false,
  37. VoidCallback? onEditingComplete,
  38. ValueChanged<String>? onSubmit,
  39. AppPrivateCommandCallback? onAppPrivateCommand,
  40. List<TextInputFormatter>? inputFormatters,
  41. bool enabled = true,
  42. bool? ignorePointers,
  43. bool enableInteractiveSelection = true,
  44. TextSelectionControls? selectionControls,
  45. DragStartBehavior dragStartBehavior = .start,
  46. MouseCursor? mouseCursor,
  47. FTextFieldCounterBuilder? counterBuilder,
  48. ScrollPhysics? scrollPhysics,
  49. ScrollController? scrollController,
  50. Iterable<String>? autofillHints,
  51. String? restorationId,
  52. bool stylusHandwritingEnabled = true,
  53. bool enableIMEPersonalizedLearning = true,
  54. ContentInsertionConfiguration? contentInsertionConfiguration,
  55. EditableTextContextMenuBuilder? contextMenuBuilder = FTextField.defaultContextMenuBuilder,
  56. bool canRequestFocus = true,
  57. UndoHistoryController? undoController,
  58. SpellCheckConfiguration? spellCheckConfiguration,
  59. FFieldIconBuilder<FAutocompleteStyle>? prefixBuilder,
  60. FFieldIconBuilder<FAutocompleteStyle>? suffixBuilder,
  61. bool clearable(
    1. TextEditingValue value
    ) = FTextField.defaultClearable,
  62. FAutocompletePopoverBuilder popoverBuilder = FPopover.defaultPopoverBuilder,
  63. FormFieldSetter<T>? onSaved,
  64. VoidCallback? onReset,
  65. FormFieldValidator<T>? validator,
  66. AutovalidateMode autovalidateMode = .disabled,
  67. String? forceErrorText,
  68. Widget errorBuilder(
    1. BuildContext context,
    2. String message
    ) = FFormFieldProperties.defaultErrorBuilder,
  69. AlignmentGeometry contentAnchor = .topStart,
  70. AlignmentGeometry fieldAnchor = .bottomStart,
  71. FPortalConstraints contentConstraints = const FAutoWidthPortalConstraints(maxHeight: 300),
  72. FPortalSpacing contentSpacing = const .spacing(4),
  73. FPortalOverflow contentOverflow = .flip,
  74. Offset contentOffset = .zero,
  75. bool contentUseViewPadding = true,
  76. bool contentUseViewInsets = true,
  77. FPopoverHideRegion contentHideRegion = .excludeChild,
  78. Object? contentGroupId,
  79. bool contentCutout = true,
  80. void contentCutoutBuilder(
    1. Path path,
    2. Rect bounds
    ) = FModalBarrier.defaultCutoutBuilder,
  81. bool autoHide = true,
  82. bool? retainFocus,
  83. FFieldBuilder<FAutocompleteStyle> builder = FTextField.defaultBuilder,
  84. bool rightArrowToComplete = false,
  85. ScrollController? contentScrollController,
  86. ScrollPhysics contentPhysics = const ClampingScrollPhysics(),
  87. FItemDivider contentDivider = .none,
  88. Widget contentEmptyBuilder(
    1. BuildContext context,
    2. FAutocompleteContentStyle style
    )? = defaultContentEmptyBuilder,
  89. Widget contentLoadingBuilder(
    1. BuildContext context,
    2. FAutocompleteContentStyle style
    )? = defaultContentLoadingBuilder,
  90. Widget contentErrorBuilder(
    1. BuildContext context,
    2. FAutocompleteContentStyle style,
    3. Object? error,
    4. StackTrace stackTrace,
    )? = defaultContentErrorBuilder,
  91. ValueChanged<T>? onItemPress,
  92. Key? key,
})

Creates a FAutocomplete that uses the given filter to determine the results and the contentBuilder to build the content.

See:

Implementation

const FAutocomplete.builder({
  required this.filter,
  required this.format,
  required this.parse,
  required this.contentBuilder,
  this.control = const .managed(),
  this.popoverControl = const .managed(),
  this.size = .md,
  this.style = const .context(),
  this.label,
  this.hint,
  this.description,
  this.magnifierConfiguration,
  this.groupId = EditableText,
  this.focusNode,
  this.keyboardType,
  this.textInputAction,
  this.textCapitalization = .none,
  this.textAlign = .start,
  this.textAlignVertical,
  this.textDirection,
  this.contentOnTapHide,
  this.autofocus = false,
  this.obscuringCharacter = '•',
  this.obscureText = false,
  this.autocorrect = true,
  this.smartDashesType,
  this.smartQuotesType,
  this.enableSuggestions = true,
  this.minLines,
  this.maxLines = 1,
  this.expands = false,
  this.readOnly = false,
  this.showCursor,
  this.maxLength,
  this.maxLengthEnforcement,
  this.onTapAlwaysCalled = false,
  this.onEditingComplete,
  this.onSubmit,
  this.onAppPrivateCommand,
  this.inputFormatters,
  this.enabled = true,
  this.ignorePointers,
  this.enableInteractiveSelection = true,
  this.selectionControls,
  this.dragStartBehavior = .start,
  this.mouseCursor,
  this.counterBuilder,
  this.scrollPhysics,
  this.scrollController,
  this.autofillHints,
  this.restorationId,
  this.stylusHandwritingEnabled = true,
  this.enableIMEPersonalizedLearning = true,
  this.contentInsertionConfiguration,
  this.contextMenuBuilder = FTextField.defaultContextMenuBuilder,
  this.canRequestFocus = true,
  this.undoController,
  this.spellCheckConfiguration,
  this.prefixBuilder,
  this.suffixBuilder,
  this.clearable = FTextField.defaultClearable,
  this.popoverBuilder = FPopover.defaultPopoverBuilder,
  this.onSaved,
  this.onReset,
  this.validator,
  this.autovalidateMode = .disabled,
  this.forceErrorText,
  this.errorBuilder = FFormFieldProperties.defaultErrorBuilder,
  this.contentAnchor = .topStart,
  this.fieldAnchor = .bottomStart,
  this.contentConstraints = const FAutoWidthPortalConstraints(maxHeight: 300),
  this.contentSpacing = const .spacing(4),
  this.contentOverflow = .flip,
  this.contentOffset = .zero,
  this.contentUseViewPadding = true,
  this.contentUseViewInsets = true,
  this.contentHideRegion = .excludeChild,
  this.contentGroupId,
  this.contentCutout = true,
  this.contentCutoutBuilder = FModalBarrier.defaultCutoutBuilder,
  this.autoHide = true,
  this.retainFocus,
  this.builder = FTextField.defaultBuilder,
  this.rightArrowToComplete = false,
  this.contentScrollController,
  this.contentPhysics = const ClampingScrollPhysics(),
  this.contentDivider = .none,
  this.contentEmptyBuilder = defaultContentEmptyBuilder,
  this.contentLoadingBuilder = defaultContentLoadingBuilder,
  this.contentErrorBuilder = defaultContentErrorBuilder,
  this.onItemPress,
  super.key,
});