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. FAutocompleteStyle style(
    1. FAutocompleteStyle style
    )?,
  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. WidgetStatesController? statesController,
  21. String obscuringCharacter = '•',
  22. bool obscureText = false,
  23. bool autocorrect = true,
  24. SmartDashesType? smartDashesType,
  25. SmartQuotesType? smartQuotesType,
  26. bool enableSuggestions = true,
  27. int? minLines,
  28. int? maxLines = 1,
  29. bool expands = false,
  30. bool readOnly = false,
  31. bool? showCursor,
  32. int? maxLength,
  33. MaxLengthEnforcement? maxLengthEnforcement,
  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 = .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 value
    ) = _clearable,
  60. FormFieldSetter<String>? onSaved,
  61. VoidCallback? onReset,
  62. FormFieldValidator<String>? validator,
  63. AutovalidateMode autovalidateMode = .disabled,
  64. String? forceErrorText,
  65. Widget errorBuilder(
    1. BuildContext context,
    2. String message
    ) = FFormFieldProperties.defaultErrorBuilder,
  66. AlignmentGeometry contentAnchor = AlignmentDirectional.topStart,
  67. AlignmentGeometry fieldAnchor = AlignmentDirectional.bottomStart,
  68. FPortalConstraints contentConstraints = const FAutoWidthPortalConstraints(maxHeight: 300),
  69. FPortalSpacing contentSpacing = const .spacing(4),
  70. FPortalOverflow contentOverflow = .flip,
  71. Offset contentOffset = .zero,
  72. FPopoverHideRegion contentHideRegion = .excludeChild,
  73. Object? contentGroupId,
  74. bool autoHide = true,
  75. FFieldBuilder<FAutocompleteStyle> builder = _builder,
  76. bool rightArrowToComplete = false,
  77. ScrollController? contentScrollController,
  78. ScrollPhysics contentPhysics = const ClampingScrollPhysics(),
  79. FItemDivider contentDivider = .none,
  80. Widget contentEmptyBuilder(
    1. BuildContext context,
    2. FAutocompleteContentStyle style
    ) = defaultContentEmptyBuilder,
  81. Widget contentLoadingBuilder(
    1. BuildContext context,
    2. FAutocompleteContentStyle style
    ) = defaultContentLoadingBuilder,
  82. Widget contentErrorBuilder(
    1. BuildContext context,
    2. Object? error,
    3. StackTrace stackTrace
    )?,
  83. 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,
  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.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.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 = AlignmentDirectional.topStart,
  this.fieldAnchor = AlignmentDirectional.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,
});