Flutter UI Walkthrough — Search Box & Suggestions
What the shopper sees
At the top of the Search Results screen sits a single search field (hint “Search products”) with a filter/tune icon beside it — the icon carries a small blue dot badge whenever a filter is currently active. As the shopper types, a dropdown opens beneath the field: a “Search for ‘<query>’” row first, then keyword suggestions (e.g. “dress for Women”), then product suggestions, each product row carrying its own thumbnail image and name.
What the shopper does here
- Types three or more characters to see live suggestions — anything shorter shows no dropdown at all.
- Taps a keyword suggestion, a product suggestion, or the literal “Search for ‘<query>’” row to actually run the search and populate the results grid below.
- Taps the tune icon to open the Search Filter sheet on top of this screen.
- Submitting an empty query is a no-op — nothing runs until a non-empty query is entered.
How it’s built
SearchFilterBox/SearchFilterBoxController (ui-application/src/lib/features/dashboard/search/widgets/) render the field, dropdown, and tune icon — the same widget/controller pair the Shop screen’s own header search bar reuses under a different GetX tag, so each screen instance keeps its own independent state. The dropdown is live only when this screen’s screenType == 'search', which is also what makes the tune icon and structured filtering available here but not on the fixed-section “See All” screens.
Typing never touches the results grid. onChanged feeds only a REST suggestProducts call — debounced 350ms and gated by a minimum 3-character query (_minSuggestionQueryLength) — that populates the dropdown. Only tapping a dropdown row (SearchScreenController.selectSuggestion/selectKeyword) or submitting the raw query (searchRawQuery) sets the active keyword — and, for a demographic-scoped keyword, an auto-applied gender filter — clears any structured filter already in place, and immediately re-runs the paginated GraphQL searchProducts query via loadInitial(). searchRawQuery returns early if the trimmed value is empty.

Related Documents
- Search Filter
- shop-service
- search-service
- Previous: Just For You — See All
- Next: Search Filter