Closed avensteven closed 1 week ago
Describe the bug In the document, there is a bug in the source code of the AutoSuggestBox component. The placeholder property does not exist in the AutoSuggestBoxItem component, but should be in the AutoSuggestBox component.
error code
String? selectedCat; AutoSuggestBox<String>( items: cats.map((cat) { return AutoSuggestBoxItem<String>( placeholder: 'Type a cat name', value: cat, label: cat, onFocusChange: (focused) { if (focused) { debugPrint('Focused $cat'); } } ); }).toList(), onSelected: (item) { setState(() => selected = item); }, ), const cats = <String>[ 'Abyssinian', 'Aegean', 'American Bobtail', 'American Curl', ... ];
right code
String? selectedCat; AutoSuggestBox<String>( placeholder: 'Type a cat name', items: cats.map((cat) { return AutoSuggestBoxItem<String>( value: cat, label: cat, onFocusChange: (focused) { if (focused) { debugPrint('Focused $cat'); } } ); }).toList(), onSelected: (item) { setState(() => selected = item); }, ), const cats = <String>[ 'Abyssinian', 'Aegean', 'American Bobtail', 'American Curl', ... ];
Describe the bug In the document, there is a bug in the source code of the AutoSuggestBox component. The placeholder property does not exist in the AutoSuggestBoxItem component, but should be in the AutoSuggestBox component.
error code
right code