FAutocomplete.builder constructor
const
FAutocomplete.builder({
- required FutureOr<
Iterable< filter(String> >- String text
- required FAutoCompleteContentBuilder contentBuilder,
- FAutocompleteControl control = const .managed(),
- FPopoverControl popoverControl = const .managed(),
- FAutocompleteStyle style(
- FAutocompleteStyle style
- Widget? label,
- String? hint,
- Widget? description,
- TextMagnifierConfiguration? magnifierConfiguration,
- Object groupId = EditableText,
- FocusNode? focusNode,
- TextInputType? keyboardType,
- TextInputAction? textInputAction,
- TextCapitalization textCapitalization = .none,
- TextAlign textAlign = .start,
- TextAlignVertical? textAlignVertical,
- TextDirection? textDirection,
- VoidCallback? contentOnTapHide,
- bool autofocus = false,
- WidgetStatesController? statesController,
- String obscuringCharacter = '•',
- bool obscureText = false,
- bool autocorrect = true,
- SmartDashesType? smartDashesType,
- SmartQuotesType? smartQuotesType,
- bool enableSuggestions = true,
- int? minLines,
- int? maxLines = 1,
- bool expands = false,
- bool readOnly = false,
- bool? showCursor,
- int? maxLength,
- MaxLengthEnforcement? maxLengthEnforcement,
- bool onTapAlwaysCalled = false,
- VoidCallback? onEditingComplete,
- ValueChanged<
String> ? onSubmit, - AppPrivateCommandCallback? onAppPrivateCommand,
- List<
TextInputFormatter> ? inputFormatters, - bool enabled = true,
- bool? ignorePointers,
- bool enableInteractiveSelection = true,
- TextSelectionControls? selectionControls,
- DragStartBehavior dragStartBehavior = .start,
- MouseCursor? mouseCursor,
- FTextFieldCounterBuilder? counterBuilder,
- ScrollPhysics? scrollPhysics,
- ScrollController? scrollController,
- Iterable<
String> ? autofillHints, - String? restorationId,
- bool stylusHandwritingEnabled = true,
- bool enableIMEPersonalizedLearning = true,
- ContentInsertionConfiguration? contentInsertionConfiguration,
- EditableTextContextMenuBuilder? contextMenuBuilder,
- bool canRequestFocus = true,
- UndoHistoryController? undoController,
- SpellCheckConfiguration? spellCheckConfiguration,
- FFieldIconBuilder<
FAutocompleteStyle> ? prefixBuilder, - FFieldIconBuilder<
FAutocompleteStyle> ? suffixBuilder, - bool clearable(
- TextEditingValue value
- FormFieldSetter<
String> ? onSaved, - VoidCallback? onReset,
- FormFieldValidator<
String> ? validator, - AutovalidateMode autovalidateMode = .disabled,
- String? forceErrorText,
- Widget errorBuilder(
- BuildContext context,
- String message
- AlignmentGeometry contentAnchor = AlignmentDirectional.topStart,
- AlignmentGeometry fieldAnchor = AlignmentDirectional.bottomStart,
- FPortalConstraints contentConstraints = const FAutoWidthPortalConstraints(maxHeight: 300),
- FPortalSpacing contentSpacing = const .spacing(4),
- FPortalOverflow contentOverflow = .flip,
- Offset contentOffset = .zero,
- FPopoverHideRegion contentHideRegion = .excludeChild,
- Object? contentGroupId,
- bool autoHide = true,
- FFieldBuilder<
FAutocompleteStyle> builder = _builder, - bool rightArrowToComplete = false,
- ScrollController? contentScrollController,
- ScrollPhysics contentPhysics = const ClampingScrollPhysics(),
- FItemDivider contentDivider = .none,
- Widget contentEmptyBuilder(
- BuildContext context,
- FAutocompleteContentStyle style
- Widget contentLoadingBuilder(
- BuildContext context,
- FAutocompleteContentStyle style
- Widget contentErrorBuilder(
- BuildContext context,
- Object? error,
- StackTrace stackTrace
- 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,
});