FAutocomplete.builder constructor

const FAutocomplete.builder({
  1. required FutureOr<Iterable<String>> filter(
    1. String text
    ),
  2. required FAutoCompleteContentBuilder contentBuilder,
  3. FAutocompleteStyle style(
    1. FAutocompleteStyle
    )?,
  4. Widget? label,
  5. String? hint,
  6. Widget? description,
  7. TextMagnifierConfiguration? magnifierConfiguration,
  8. Object groupId = EditableText,
  9. FAutocompleteController? controller,
  10. FocusNode? focusNode,
  11. TextInputType? keyboardType,
  12. TextInputAction? textInputAction,
  13. TextCapitalization textCapitalization = TextCapitalization.none,
  14. TextAlign textAlign = TextAlign.start,
  15. TextAlignVertical? textAlignVertical,
  16. TextDirection? textDirection,
  17. VoidCallback? onTapHide,
  18. bool autofocus = false,
  19. WidgetStatesController? statesController,
  20. String obscuringCharacter = '•',
  21. bool obscureText = false,
  22. bool autocorrect = true,
  23. SmartDashesType? smartDashesType,
  24. SmartQuotesType? smartQuotesType,
  25. bool enableSuggestions = true,
  26. int? minLines,
  27. int? maxLines = 1,
  28. bool expands = false,
  29. bool readOnly = false,
  30. bool? showCursor,
  31. int? maxLength,
  32. MaxLengthEnforcement? maxLengthEnforcement,
  33. ValueChanged<String>? onChange,
  34. bool onTapAlwaysCalled = false,
  35. VoidCallback? onEditingComplete,
  36. ValueChanged<String>? onSubmit,
  37. AppPrivateCommandCallback? onAppPrivateCommand,
  38. List<TextInputFormatter>? inputFormatters,
  39. bool enabled = true,
  40. bool? ignorePointers,
  41. bool enableInteractiveSelection = true,
  42. TextSelectionControls? selectionControls,
  43. DragStartBehavior dragStartBehavior = DragStartBehavior.start,
  44. MouseCursor? mouseCursor,
  45. FTextFieldCounterBuilder? counterBuilder,
  46. ScrollPhysics? scrollPhysics,
  47. ScrollController? scrollController,
  48. Iterable<String>? autofillHints,
  49. String? restorationId,
  50. bool stylusHandwritingEnabled = true,
  51. bool enableIMEPersonalizedLearning = true,
  52. ContentInsertionConfiguration? contentInsertionConfiguration,
  53. EditableTextContextMenuBuilder? contextMenuBuilder,
  54. bool canRequestFocus = true,
  55. UndoHistoryController? undoController,
  56. SpellCheckConfiguration? spellCheckConfiguration,
  57. FFieldIconBuilder<FAutocompleteStyle>? prefixBuilder,
  58. FFieldIconBuilder<FAutocompleteStyle>? suffixBuilder,
  59. bool clearable(
    1. TextEditingValue
    ) = _clearable,
  60. FormFieldSetter<String>? onSaved,
  61. FormFieldValidator<String>? validator,
  62. String? initialText,
  63. AutovalidateMode autovalidateMode = AutovalidateMode.disabled,
  64. String? forceErrorText,
  65. Widget errorBuilder(
    1. BuildContext,
    2. String
    ) = FFormFieldProperties.defaultErrorBuilder,
  66. AlignmentGeometry anchor = AlignmentDirectional.topStart,
  67. AlignmentGeometry fieldAnchor = AlignmentDirectional.bottomStart,
  68. FPortalConstraints popoverConstraints = const FAutoWidthPortalConstraints(maxHeight: 300),
  69. FPortalSpacing spacing = const FPortalSpacing(4),
  70. Offset shift(
    1. Size,
    2. FPortalChildBox,
    3. FPortalBox
    ) = FPortalShift.flip,
  71. Offset offset = Offset.zero,
  72. FPopoverHideRegion hideRegion = FPopoverHideRegion.excludeChild,
  73. bool autoHide = true,
  74. FFieldBuilder<FAutocompleteStyle> builder = _builder,
  75. bool rightArrowToComplete = false,
  76. ScrollController? contentScrollController,
  77. ScrollPhysics contentPhysics = const ClampingScrollPhysics(),
  78. FItemDivider contentDivider = FItemDivider.none,
  79. Widget contentEmptyBuilder(
    1. BuildContext,
    2. FAutocompleteContentStyle
    ) = defaultContentEmptyBuilder,
  80. Widget contentLoadingBuilder(
    1. BuildContext,
    2. FAutocompleteContentStyle
    ) = defaultContentLoadingBuilder,
  81. Widget contentErrorBuilder(
    1. BuildContext,
    2. Object?,
    3. StackTrace
    )?,
  82. Key? key,
})

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

Implementation

const FAutocomplete.builder({
  required this.filter,
  required this.contentBuilder,
  this.style,
  this.label,
  this.hint,
  this.description,
  this.magnifierConfiguration,
  this.groupId = EditableText,
  this.controller,
  this.focusNode,
  this.keyboardType,
  this.textInputAction,
  this.textCapitalization = TextCapitalization.none,
  this.textAlign = TextAlign.start,
  this.textAlignVertical,
  this.textDirection,
  this.onTapHide,
  this.autofocus = false,
  this.statesController,
  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.onChange,
  this.onTapAlwaysCalled = false,
  this.onEditingComplete,
  this.onSubmit,
  this.onAppPrivateCommand,
  this.inputFormatters,
  this.enabled = true,
  this.ignorePointers,
  this.enableInteractiveSelection = true,
  this.selectionControls,
  this.dragStartBehavior = DragStartBehavior.start,
  this.mouseCursor,
  this.counterBuilder,
  this.scrollPhysics,
  this.scrollController,
  this.autofillHints,
  this.restorationId,
  this.stylusHandwritingEnabled = true,
  this.enableIMEPersonalizedLearning = true,
  this.contentInsertionConfiguration,
  this.contextMenuBuilder,
  this.canRequestFocus = true,
  this.undoController,
  this.spellCheckConfiguration,
  this.prefixBuilder,
  this.suffixBuilder,
  this.clearable = _clearable,
  this.onSaved,
  this.validator,
  this.initialText,
  this.autovalidateMode = AutovalidateMode.disabled,
  this.forceErrorText,
  this.errorBuilder = FFormFieldProperties.defaultErrorBuilder,
  this.anchor = AlignmentDirectional.topStart,
  this.fieldAnchor = AlignmentDirectional.bottomStart,
  this.popoverConstraints = const FAutoWidthPortalConstraints(maxHeight: 300),
  this.spacing = const FPortalSpacing(4),
  this.shift = FPortalShift.flip,
  this.offset = Offset.zero,
  this.hideRegion = FPopoverHideRegion.excludeChild,
  this.autoHide = true,
  this.builder = _builder,
  this.rightArrowToComplete = false,
  this.contentScrollController,
  this.contentPhysics = const ClampingScrollPhysics(),
  this.contentDivider = FItemDivider.none,
  this.contentEmptyBuilder = defaultContentEmptyBuilder,
  this.contentLoadingBuilder = defaultContentLoadingBuilder,
  this.contentErrorBuilder,
  super.key,
}) : assert(
       controller == null || initialText == null,
       'Cannot provide both a controller and initialText. To fix, set the initial text directly in the controller.',
     );