Skip to main content

AutoComplete

The Stac AutoComplete allows you to build a Flutter AutoComplete widget using JSON. To know more about the AutoComplete widget in Flutter, refer to the official documentation.

Properties​

PropertyTypeDescription
optionsList<String>The list of options for the autocomplete.
onSelectedMap<String, dynamic>?The callback that is called when an option is selected.
optionsMaxHeightdoubleThe maximum height of the options list. Defaults to 200.
optionsViewOpenDirectionOptionsViewOpenDirectionThe direction in which the options view opens. Defaults to OptionsViewOpenDirection.down.
initialValueString?The initial value of the autocomplete field.

Example JSON​

{
"type": "autoComplete",
"options": ["Option 1", "Option 2", "Option 3"],
"onSelected": {
"type": "callback",
"name": "onOptionSelected"
},
"optionsMaxHeight": 250,
"optionsViewOpenDirection": "up",
"initialValue": "Option 1"
}