Orders Screen
views/orders_screen.dart
Overview
Single screen with role-aware tabs. Customers see All / Pending / Fulfilled / Delivered. Sellers see All / Pending / Canceled. The active provider (customer vs seller) is selected by userRoleProvider.
User Flow
- _OrdersScreenState builds a TabController with 4 tabs.
- build watches userRoleProvider and the matching list provider.
- _filterOrders applies a per-tab status filter against the list returned by the provider.
- Pull-to-refresh calls the matching controller's refreshOrders.
Cases & Edge Cases
- isSeller branch uses the seller filter set (pending / canceled) — customer branch uses fulfillment buckets (pending / shipped / delivered).
- Empty-state messaging differs per role — sellers see 'no pending orders', customers see 'no purchases yet'.
- TabController length is hard-coded to 4 — adding a 5th tab requires changing the ctor.
Code References
- lib/src/features/shared/orders/views/orders_screen.dart:16 // OrdersScreen
- lib/src/features/shared/orders/views/orders_screen.dart:41 // _filterOrders
API Calls
Empty — fill this in later. Open the manifest and add content here.
Notes
Tab order is fixed in code — the labels come from S.current.* localizations, so changing copy is a single ARB change.