FAutocomplete.builder constructor

const FAutocomplete.builder({
  1. required FutureOr<Iterable<String>> filter(
    1. String text
    ),
  2. required FAutoCompleteContentBuilder contentBuilder,
  3. FAutocompleteControl control = const .managed(),
  4. FPopoverControl popoverControl = const .managed(),
  5. FAutocompleteStyleDelta style = const .context(),
  6. Widget? label,
  7. String? hint,
  8. Widget? description,
  9. TextMagnifierConfiguration? magnifierConfiguration,
  10. Object groupId = EditableText,
  11. FocusNode? focusNode,
  12. TextInputType? keyboardType,
  13. TextInputAction? textInputAction,
  14. TextCapitalization textCapitalization = .none,
  15. TextAlign textAlign = .start,
  16. TextAlignVertical? textAlignVertical,
  17. TextDirection? textDirection,
  18. VoidCallback? contentOnTapHide,
  19. bool autofocus = false,
  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. bool onTapAlwaysCalled = false,
  34. VoidCallback? onEditingComplete,
  35. ValueChanged<String>? onSubmit,
  36. AppPrivateCommandCallback? onAppPrivateCommand,
  37. List<TextInputFormatter>? inputFormatters,
  38. bool enabled = true,
  39. bool? ignorePointers,
  40. bool enableInteractiveSelection = true,
  41. TextSelectionControls? selectionControls,
  42. DragStartBehavior dragStartBehavior = .start,
  43. MouseCursor? mouseCursor,
  44. FTextFieldCounterBuilder? counterBuilder,
  45. ScrollPhysics? scrollPhysics,
  46. ScrollController? scrollController,
  47. Iterable<String>? autofillHints,
  48. String? restorationId,
  49. bool stylusHandwritingEnabled = true,
  50. bool enableIMEPersonalizedLearning = true,
  51. ContentInsertionConfiguration? contentInsertionConfiguration,
  52. EditableTextContextMenuBuilder? contextMenuBuilder,
  53. bool canRequestFocus = true,
  54. UndoHistoryController? undoController,
  55. SpellCheckConfiguration? spellCheckConfiguration,
  56. FFieldIconBuilder<FAutocompleteStyle>? prefixBuilder,
  57. FFieldIconBuilder<FAutocompleteStyle>? suffixBuilder,
  58. bool clearable(
    1. TextEditingValue value
    ) = _clearable,
  59. FormFieldSetter<String>? onSaved,
  60. VoidCallback? onReset,
  61. FormFieldValidator<String>? validator,
  62. AutovalidateMode autovalidateMode = .disabled,
  63. String? forceErrorText,
  64. Widget errorBuilder(
    1. BuildContext context,
    2. String message
    ) = FFormFieldProperties.defaultErrorBuilder,
  65. AlignmentGeometry contentAnchor = .topStart,
  66. AlignmentGeometry fieldAnchor = .bottomStart,
  67. FPortalConstraints contentConstraints = const FAutoWidthPortalConstraints(maxHeight: 300),
  68. FPortalSpacing contentSpacing = const .spacing(4),
  69. FPortalOverflow contentOverflow = .flip,
  70. Offset contentOffset = .zero,
  71. FPopoverHideRegion contentHideRegion = .excludeChild,
  72. Object? contentGroupId,
  73. bool autoHide = true,
  74. FFieldBuilder<FAutocompleteStyle> builder = _builder,
  75. bool rightArrowToComplete = false,
  76. ScrollController? contentScrollController,
  77. ScrollPhysics contentPhysics = const ClampingScrollPhysics(),
  78. FItemDivider contentDivider = .none,
  79. Widget contentEmptyBuilder(
    1. BuildContext context,
    2. FAutocompleteContentStyle style
    ) = defaultContentEmptyBuilder,
  80. Widget contentLoadingBuilder(
    1. BuildContext context,
    2. FAutocompleteContentStyle style
    ) = defaultContentLoadingBuilder,
  81. Widget contentErrorBuilder(
    1. BuildContext context,
    2. Object? error,
    3. StackTrace 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.control = const .managed(),
  this.popoverControl = const .managed(),
  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,
  this.canRequestFocus = true,
  this.undoController,
  this.spellCheckConfiguration,
  this.prefixBuilder,
  this.suffixBuilder,
  this.clearable = _clearable,
  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.contentHideRegion = .excludeChild,
  this.contentGroupId,
  this.autoHide = true,
  this.builder = _builder,
  this.rightArrowToComplete = false,
  this.contentScrollController,
  this.contentPhysics = const ClampingScrollPhysics(),
  this.contentDivider = .none,
  this.contentEmptyBuilder = defaultContentEmptyBuilder,
  this.contentLoadingBuilder = defaultContentLoadingBuilder,
  this.contentErrorBuilder,
  super.key,
});