Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ class MiraiAutoComplete with _$MiraiAutoComplete {
required List<String> options,
Map<String, dynamic>? onSelected,
@Default(200) double optionsMaxHeight,
// optionsViewBuilder,
@Default(OptionsViewOpenDirection.down)
OptionsViewOpenDirection optionsViewOpenDirection,
String? initialValue,
Expand Down
30 changes: 30 additions & 0 deletions website/docs/widgets/auto_complete.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# AutoComplete

The Mirai 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](https://api.flutter.dev/flutter/material/Autocomplete-class.html).

## Properties

| Property | Type | Description |
|--------------------------|----------------------------|---------------------------------------------------------------------------------------------|
| options | `List<String>` | The list of options for the autocomplete. |
| onSelected | `Map<String, dynamic>?` | The callback that is called when an option is selected. |
| optionsMaxHeight | `double` | The maximum height of the options list. Defaults to `200`. |
| optionsViewOpenDirection | `OptionsViewOpenDirection` | The direction in which the options view opens. Defaults to `OptionsViewOpenDirection.down`. |
| initialValue | `String?` | The initial value of the autocomplete field. |

## Example JSON

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