CustomAutocomplete<T extends Object> class

Wraps RawAutocomplete with LayoutBuilder in order to prevent the width from overflowing the screen.

This should solve https://github.com/flutter/flutter/issues/78746

Inheritance

Constructors

CustomAutocomplete({Key? key, required ValueChanged<String> onChanged, required ValueChanged<T> onSelected, required List<T> optionsBuilder(String), bool autofocus = false, AutocompleteOptionToString<T> displayStringForOption = _defaultStringForOption, String? errorText, bool hasError = false, String initialValue = '', TextInputType? keyboardType = TextInputType.text, String? labelText = '', Widget? prefixIcon, EdgeInsets scrollPadding = const EdgeInsets.all(200.0), TextCapitalization textCapitalization = TextCapitalization.none, TextInputAction? textInputAction})
Wraps RawAutocomplete with LayoutBuilder in order to prevent the width from overflowing the screen.
const

Properties

autofocus bool
Determines whether to auto focus this input.
final
displayStringForOption AutocompleteOptionToString<T>
Returns the string to display in the field when the option is selected.
final
errorText String?
The text shown when there is an error.
final
hasError bool
Determines if an error should be displayed.
final
hashCode int
The hash code for this object.
no setterinherited
initialValue String
The initial value of this input.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
keyboardType TextInputType?
The type of information for which to optimize the text input control.
final
labelText String?
An optional label for this input. This defaults to an empty string in order to keep the height of this widget the same as other text fields.
final
onChanged ValueChanged<String>
Called when the value of the input changes.
final
onSelected ValueChanged<T>
Called when a selection is made.
final
optionsBuilder List<T> Function(String)
A function that returns the current selectable options objects given the current TextEditingValue.text.
final
prefixIcon Widget?
An icon that appears before the editable part of the text field.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scrollPadding EdgeInsets
Used to allow the input enough room for the dropdown.
final
textCapitalization TextCapitalization
Determines whether to show an uppercase or lowercase keyboard.
final
textInputAction TextInputAction?
An action the user has requested the text input control to perform.
final

Methods

build(BuildContext context) Widget
Describes the part of the user interface represented by this widget.
override
createElement() StatelessElement
Creates a StatelessElement to manage this widget's location in the tree.
inherited
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