Flutter UI Walkthrough — Search Filter
What the shopper sees
Tapping the tune icon on the Search Box slides up a bottom sheet headed “Filter” with a close icon. A pinned row of product-type/group chips (Clothing, Shoes, Bags, Watches, …) stays fixed at the top; everything below it scrolls: category image-chips, a gender/demographic toggle row, a variant selector (e.g. Size) shown only when the selected group has one, a color-swatch picker shown only when the selected group has one, a price range slider, a discount range slider, and a section-scope selector (All / Top Products / New Arrivals / Flash Sale / Just For You) to narrow which content section’s results the filter applies against. A Clear button and an Apply button anchor the bottom.
What the shopper does here
- Picks a product-type group at the top — this changes which categories, variant options, and colors are available below it.
- Toggles categories, gender, variant, and color selections.
- Drags the price and discount range sliders.
- Picks a section scope to narrow results to one content section instead of everything.
- Taps Clear to reset every filter back to the schema’s own defaults (including re-selecting the first group).
- Taps Apply to send every current selection back to the screen underneath and close the sheet — the results grid refreshes in place; nothing navigates anywhere.
How it’s built
FilterBottomSheet/FilterController (ui-application/src/lib/features/dashboard/filter/) is not a routed page — it’s opened via Get.bottomSheet(...) from SearchFilterBoxController.openFilterBottomSheet(), the same call site the Search screen and the Shop screen’s own tune icon both use, so the caller must run FilterBinding().dependencies() immediately before opening it. On open, FilterController loads its available groups/categories/attributes from shop-service’s GET /api/v1/filter/schema rather than any hardcoded list, so what a shopper sees here always matches the tenant’s own admin-configured category groups and catalog attributes.
Tapping Apply builds a FilterResultPayload (buildResultPayload()) and hands it to the caller’s own onApplyFilters callback rather than navigating anywhere itself — on the Search screen this calls SearchScreenController.applyFilters(payload, group, colorHex), which resets pagination and re-runs the same paginated GraphQL searchProducts query the screen already uses for its grid. A Sort section exists in the code but is intentionally not rendered today — sorting isn’t wired to the backend search query yet.
