Flutter UI Walkthrough — My Orders

By Engineering Team•October 3, 2026•4 min read

Where this flow starts

Reached by tapping the bottom navigation’s My Orders tab (index 3). MainLayoutController.changePage() routes this tab with Get.toNamed(AppRoutes.myOrders) instead of swapping it into the nested tab IndexedStack the way Shop/Settings tabs do — the same push-on-root-navigator shape as Cart and Wishlist. One consequence of that: the tab doesn’t become visually “selected” the way a true IndexedStack tab would.

What the shopper sees

A My Orders header above a horizontally-scrollable row of status filter chips — All, Placed, Packing, Shipped, Delivered, and Cancelled/Refunded (the last one or two scroll into view; the screen only shows a few at a time). Below that, a list of order cards, each with an order number, a timestamp, a color-coded status badge, one or more line items (thumbnail, name, quantity × price, a strikethrough MRP, and a “You save ₹X” line), a Total row, and two buttons — an outlined View and a filled Track. A Load More button appears at the bottom whenever another page of orders is available.

What the shopper does here

  • Taps a filter chip to switch which orders are shown — this re-queries the server rather than filtering an already-loaded list.
  • Taps Load More to fetch the next page of orders for the current filter.
  • Taps View on a card to open that order’s Order Details screen.
  • Taps Track on a card to jump straight to that order’s Track Shipment screen.

How it’s built

This list is a real, always-fresh server query — not a cache. MyOrdersController.loadOrders()/.loadMore() call OrderService.getMyOrders(status, offset, limit), which runs a GraphQL MyOrders($status, $offset, $limit) query against shop-service’s order-query orchestrator with fetchPolicy: FetchPolicy.networkOnly — every tab switch or page load hits the network, nothing is read from a client cache.

The filter chips are server-side, not client-side. Each tab carries its own status string, passed straight through as the GraphQL variable: All → null, Placed → 'Placed', Packing → 'Packing', Shipped → 'Shipped', Delivered → 'Delivered', Cancelled/Refunded → 'CancelledOrRefunded'. Selecting a chip calls selectTab(), which re-runs loadOrders() with the new status rather than re-filtering an in-memory list. The status badge’s color follows the same server value: Delivered renders green, Cancelled/Refunded render red, Shipped renders blue, and anything else (Placed, Packing) renders orange.

Pagination is explicit, not infinite-scroll. Pages are fetched 10 orders at a time via an offset/limit pair; Load More is a plain tap, shown only while the server reports more orders exist — there’s no scroll-position listener driving an automatic fetch.

View and Track both push a per-order screen, not a shared one. View calls Get.toNamed(AppRoutes.orderDetails, parameters: {'orderId': order.orderId}); Track calls Get.toNamed(AppRoutes.orderTracking, parameters: {'orderId': order.orderId}). Both destination controllers are registered with Get.lazyPut(..., tag: orderId), so each order gets its own controller instance rather than reusing one shared screen state across different orders. OrderService/its underlying GraphQL repository are registered once as a permanent singleton and shared across My Orders, Order Details, Track Shipment, and Checkout alike.

My Orders screen — status filter tabs and a paginated list of order cards with View/Track actions