Open sabari7320 opened 5 months ago
Uploading Screenrecorder-2024-06-11-21-24-44-432 (1) (1).mp4…
Uploading Screenrecorder-2024-06-11-21-24-44-432 (1) (1).mp4…
Hi @sabari7320, I don't really understand what issue you are referrig to can you please edit and rephrase your issue? With minimal and complete code sample that I can run to reproduce the issue and possibly an screenshot/recordings to support your report.
Thanks
Hey @sabari7320, Thanks for the clarification. This is currenlty not possible with Searchfield. Since the suggestions are basically an overlay drawn on top of the UI as an Overlay and not in a Widget Tree. I think the only way to solve is to bring back inline Support for Suggestions which was removed https://github.com/maheshmnj/searchfield/commit/5b6189e2b47f306cfb77c38d59e0989725246ebd
I think this perfectly makes a valid use case to have a suggestions in a widget tree.
For now I think you can try something like unfocus when the user Scrolls the UI to close the Searchfield.
this feature was proposed back then https://github.com/maheshmnj/searchfield/issues/95
@sabari7320 How about you close the Searchfield when you scroll the UI?
Searchfield(
focusNode: focus,
...
)
scrollController.addListener(() {
if (scrollController.position.userScrollDirection ==
ScrollDirection.reverse) {
focus.unfocus();
}
});
You can write your custom logic, when you would like to hide the suggestions.
This approach seems better than showing the suggestions in a widget tree which would abruptly add and remove suggestions in the widget tree. lmkwyt
this is mycodesclass
code
```dart SearchFieldwithSingleSelection extends StatelessWidget { final String label; final List itemList; final TextEditingController itemController; //final String itemKey; final ValueChanged