arch-atlas

Orders Screen

views/orders_screen.dart

presentation

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

  1. _OrdersScreenState builds a TabController with 4 tabs.
  2. build watches userRoleProvider and the matching list provider.
  3. _filterOrders applies a per-tab status filter against the list returned by the provider.
  4. 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.