StacAutoComplete class

A Stac model representing Flutter's Autocomplete widget.

Provides a text field that displays a list of options while the user types.

{@tool snippet} Dart Example:

const StacAutoComplete(
  options: ['Apple', 'Banana', 'Cherry'],
  optionsMaxHeight: 250,
  optionsViewOpenDirection: StacOptionsViewOpenDirection.up,
  initialValue: 'Apple',
)

{@end-tool}

{@tool snippet} JSON Example:

{
  "type": "autoComplete",
  "options": ["Apple", "Banana", "Cherry"],
  "onSelected": {"type": "callback", "name": "onOptionSelected"},
  "optionsMaxHeight": 250,
  "optionsViewOpenDirection": "up",
  "initialValue": "Apple"
}

{@end-tool}

See also:

Inheritance
Annotations
  • @JsonSerializable.new()

Constructors

StacAutoComplete({required List<String> options, StacAction? onSelected, double? optionsMaxHeight, StacOptionsViewOpenDirection? optionsViewOpenDirection, String? initialValue})
Creates a StacAutoComplete with the given properties.
const
StacAutoComplete.fromJson(Map<String, dynamic> json)
Creates a StacAutoComplete from a JSON map.
factory

Properties

hashCode → int
The hash code for this object.
no setterinherited
initialValue → String?
The initial value of the autocomplete field.
final
jsonData → Map<String, dynamic>?
Raw JSON data for this widget
finalinherited
onSelected → StacAction?
The callback that is called when an option is selected.
final
options → List<String>
The list of options available for selection.
final
optionsMaxHeight → double?
The maximum height of the options list. Defaults to 200 in Flutter's Autocomplete.
final
optionsViewOpenDirection → StacOptionsViewOpenDirection?
The direction in which the options view opens. Defaults to StacOptionsViewOpenDirection.down.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
type → String
Widget type identifier.
no setteroverride

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, dynamic>
Converts this StacAutoComplete instance to a JSON map.
override
toString() → String
A string representation of this object.
inherited

Operators

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