FAutocomplete.builder constructor
const
FAutocomplete.builder({
- required FutureOr<
Iterable< filter(String> >- String text
- required FAutoCompleteContentBuilder contentBuilder,
- FAutocompleteStyle style(
- FAutocompleteStyle style
- Widget? label,
- String? hint,
- Widget? description,
- TextMagnifierConfiguration? magnifierConfiguration,
- Object groupId = EditableText,
- FAutocompleteController? controller,
- FocusNode? focusNode,
- TextInputType? keyboardType,
- TextInputAction? textInputAction,
- TextCapitalization textCapitalization = TextCapitalization.none,
- TextAlign textAlign = TextAlign.start,
- TextAlignVertical? textAlignVertical,
- TextDirection? textDirection,
- VoidCallback? onTapHide,
- 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,
- ValueChanged<
String> ? onChange, - 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 = 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, - String? initialText,
- AutovalidateMode autovalidateMode = AutovalidateMode.disabled,
- String? forceErrorText,
- Widget errorBuilder(
- BuildContext context,
- String message
- AlignmentGeometry anchor = AlignmentDirectional.topStart,
- AlignmentGeometry fieldAnchor = AlignmentDirectional.bottomStart,
- FPortalConstraints popoverConstraints = const FAutoWidthPortalConstraints(maxHeight: 300),
- FPortalSpacing spacing = const FPortalSpacing(4),
- Offset shift(
- Size size,
- FPortalChildBox childBox,
- FPortalBox portalBox
- Offset offset = Offset.zero,
- FPopoverHideRegion hideRegion = FPopoverHideRegion.excludeChild,
- bool autoHide = true,
- FFieldBuilder<
FAutocompleteStyle> builder = _builder, - bool rightArrowToComplete = false,
- ScrollController? contentScrollController,
- ScrollPhysics contentPhysics = const ClampingScrollPhysics(),
- FItemDivider contentDivider = FItemDivider.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.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.onReset,
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.',
);