FormBuilderTypeAhead<T> class

Text field that auto-completes user input from a list of items

Inheritance

Constructors

FormBuilderTypeAhead({Key? key, AutovalidateMode? autovalidateMode, bool enabled = true, FocusNode? focusNode, FormFieldSetter<T>? onSaved, FormFieldValidator<T>? validator, InputDecoration decoration = const InputDecoration(), T? initialValue, ValueChanged<T?>? onChanged, ValueTransformer<T?>? valueTransformer, VoidCallback? onReset, required String name, required ItemBuilder<T> itemBuilder, required SuggestionsCallback<T> suggestionsCallback, Duration animationDuration = const Duration(milliseconds: 500), double animationStart = 0.25, bool autoFlipDirection = false, TextEditingController? controller, Duration debounceDuration = const Duration(milliseconds: 300), AxisDirection direction = AxisDirection.down, ErrorBuilder? errorBuilder, bool getImmediateSuggestions = false, bool hideKeyboard = false, bool hideOnEmpty = false, bool hideOnError = false, bool hideOnLoading = false, bool hideSuggestionsOnKeyboardHide = true, bool keepSuggestionsOnLoading = true, bool keepSuggestionsOnSuggestionSelected = false, WidgetBuilder? loadingBuilder, WidgetBuilder? noItemsFoundBuilder, SuggestionSelectionCallback<T>? onSuggestionSelected, ScrollController? scrollController, SelectionToTextTransformer<T>? selectionToTextTransformer, SuggestionsBoxController? suggestionsBoxController, SuggestionsBoxDecoration suggestionsBoxDecoration = const SuggestionsBoxDecoration(), double suggestionsBoxVerticalOffset = 5.0, TextFieldConfiguration textFieldConfiguration = const TextFieldConfiguration(), AnimationTransitionBuilder? transitionBuilder, bool autoFlipListDirection = true, double autoFlipMinHeight = 64.0, bool hideKeyboardOnDrag = false, bool ignoreAccessibleNavigation = false, bool intercepting = false, IndexedWidgetBuilder? itemSeparatorBuilder, LayoutArchitecture? layoutArchitecture, int minCharsForSuggestions = 0, void onSuggestionsBoxToggle(bool)?})
Creates text field that auto-completes user input from a list of items

Properties

animationDuration Duration
The duration that transitionBuilder animation takes.
final
animationStart double
The value at which the transitionBuilder animation starts.
final
autoFlipDirection bool
If set to true, in the case where the suggestions box has less than _SuggestionsBoxController.minOverlaySpace to grow in the desired direction, the direction axis will be temporarily flipped if there's more room available in the opposite direction.
final
autoFlipListDirection bool
If set to false, suggestion list will not be reversed according to the autoFlipDirection property.
final
autoFlipMinHeight double
Minimum height below autoFlipDirection is triggered
final
autovalidateMode AutovalidateMode
Used to enable/disable this form field auto validation and update its error text.
finalinherited
builder FormFieldBuilder<T>
Function that returns the widget representing this form field. It is passed the form field state as input, containing the current value and validation state of this field.
finalinherited
controller TextEditingController?
Controls the text being edited.
final
debounceDuration Duration
The duration to wait after the user stops typing before calling suggestionsCallback
final
decoration InputDecoration
finalinherited
direction AxisDirection
Determine the SuggestionBox's direction.
final
enabled bool
Whether the form is able to receive user input.
finalinherited
errorBuilder → ErrorBuilder?
Called when suggestionsCallback throws an exception.
final
focusNode FocusNode?
An optional focus node to use as the focus node for this widget.
finalinherited
getImmediateSuggestions bool
If set to true, suggestions will be fetched immediately when the field is added to the view.
final
hashCode int
The hash code for this object.
no setterinherited
hideKeyboard bool
final
hideKeyboardOnDrag bool
If set to true and if the user scrolls through the suggestion list, hide the keyboard automatically. If set to false, the keyboard remains visible. Throws an exception, if hideKeyboardOnDrag and hideSuggestionsOnKeyboardHide are both set to true as they are mutual exclusive.
final
hideOnEmpty bool
If set to true, nothing will be shown if there are no results. noItemsFoundBuilder will also be ignored.
final
hideOnError bool
If set to true, nothing will be shown if there is an error. errorBuilder will also be ignored.
final
hideOnLoading bool
If set to true, no loading box will be shown while suggestions are being fetched. loadingBuilder will also be ignored.
final
hideSuggestionsOnKeyboardHide bool
If set to false, the suggestions box will stay opened after the keyboard is closed.
final
ignoreAccessibleNavigation bool
Allows a bypass of a problem on Flutter 3.7+ with the accessibility through Overlay that prevents flutter_typeahead to register a click on the list of suggestions properly.
final
initialValue → T?
An optional value to initialize the form field to, or null otherwise.
finalinherited
intercepting bool
Used to overcome Flutter issue 98507 Most commonly experienced when placing the TypeAheadFormField on a google map in Flutter Web.
final
itemBuilder → ItemBuilder<T>
Called for each suggestion returned by suggestionsCallback to build the corresponding widget.
final
itemSeparatorBuilder IndexedWidgetBuilder?
final
keepSuggestionsOnLoading bool
If set to false, the suggestions box will show a circular progress indicator when retrieving suggestions.
final
keepSuggestionsOnSuggestionSelected bool
If set to true, the suggestions box will remain opened even after selecting a suggestion.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
layoutArchitecture → LayoutArchitecture?
By default, we render the suggestions in a ListView, using the itemBuilder to construct each element of the list. Specify your own layoutArchitecture if you want to be responsible for layinng out the widgets using some other system (like a grid).
final
loadingBuilder WidgetBuilder?
Called when waiting for suggestionsCallback to return.
final
minCharsForSuggestions int
The minimum number of characters which must be entered before suggestionsCallback is triggered.
final
name String
Used to reference the field within the form, or to reference form data after the form is submitted.
finalinherited
noItemsFoundBuilder WidgetBuilder?
Called when suggestionsCallback returns an empty array.
final
onChanged ValueChanged<T?>?
Called when the field value is changed.
finalinherited
onReset VoidCallback?
Called when the field value is reset.
finalinherited
onSaved FormFieldSetter<T>?
An optional method to call with the final value when the form is saved via FormState.save.
finalinherited
onSuggestionsBoxToggle → (void Function(bool)?)
final
onSuggestionSelected → SuggestionSelectionCallback<T>?
Called when a suggestion is tapped.
final
restorationId String?
Restoration ID to save and restore the state of the form field.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scrollController ScrollController?
final
selectionToTextTransformer SelectionToTextTransformer<T>?
final
suggestionsBoxController → SuggestionsBoxController?
Used to control the _SuggestionsBox. Allows manual control to open, close, toggle, or resize the _SuggestionsBox.
final
suggestionsBoxDecoration → SuggestionsBoxDecoration
The decoration of the material sheet that contains the suggestions.
final
suggestionsBoxVerticalOffset double
How far below the text field should the suggestions box be
final
suggestionsCallback → SuggestionsCallback<T>
Called with the search pattern to get the search suggestions.
final
textFieldConfiguration → TextFieldConfiguration
The configuration of the TextField that the TypeAhead widget displays
final
transitionBuilder → AnimationTransitionBuilder?
Called to display animations when suggestionsCallback returns suggestions
final
validator FormFieldValidator<T>?
An optional method that validates an input. Returns an error string to display if the input is invalid, or null otherwise.
finalinherited
valueTransformer → ValueTransformer<T?>?
Called just before field value is saved. Used to massage data just before committing the value.
finalinherited

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() FormBuilderTypeAheadState<T>
Creates the mutable state for this widget at a given location in the tree.
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited