Filter / Sort Bar
widgets/marketplace_filter_bar.dart
Overview
Horizontal bar with three primary chips: Filter (opens FilterBottomSheet), Sort (SortByBottomSheet), and a Grid/List toggle. Selected filter count is displayed as a badge on the Filter chip.
User Flow
- Tap Filter → showModalBottomSheet(FilterBottomSheet) → applyCompositeFilters.
- Tap Sort → showModalBottomSheet(SortByBottomSheet) → setSortOrder.
- Tap Grid/List → controller.toggleViewType.
- Active filters are reflected as small chip indicators next to the bar.
Cases & Edge Cases
- Filter badge count is computed from state.categoryIds.length + state.tagIds.length + state.variantOptionValues.length — order changes if you re-order the filter dimensions.
- Sort by 'price_asc'/'price_desc' is client-side; 'created_at' variants are server-side — bar doesn't distinguish.
Code References
- lib/src/features/shared/marketplace/views/widgets/marketplace_filter_bar.dart
API Calls
Empty — fill this in later. Open the manifest and add content here.
Notes
Consider centralizing filter-count math in the controller as a derived getter.