Order Detail Screen
views/order_detail_screen.dart
Overview
Shows a single Order. For customers: items, tracking timeline, shipping address, totals, 'view receipt' CTA. For sellers: also customer block, split-payment status, Cancel button with confirmation dialog.
User Flow
- Reads orderId from the GoRouter path param.
- Consumes orderDetailProvider(orderId).
- Customer flow: TrackingTimeline shows fulfillmentStatus progression; Receipt button pushes ReceiptScreen.
- Seller flow: Cancel button → confirmation dialog → cancelSellerOrderProvider(orderId).future → re-fetch detail.
- Error / loading states are rendered via AsyncValue.when().
Cases & Edge Cases
- Cancelled orders disable the Cancel button and surface 'Refunded €X' computed from splitOrderPayment.refundedAmount.
- Tracking timeline interprets fulfillment_status into steps: pending → fulfilled → shipped → delivered.
- Seller has no 'view receipt' (no CTA implemented yet) — that's a customer-only flow.
Code References
- lib/src/features/shared/orders/views/order_detail_screen.dart
- lib/src/features/shared/orders/views/widgets/tracking_timeline.dart
API Calls
Empty — fill this in later. Open the manifest and add content here.
Notes
Long screen (~1k lines) with inline subwidgets — pulling them out into widgets/* would simplify cross-role testing.