Flutter UI Walkthrough — Checkout
What the shopper sees
Top to bottom: a Shipping Address card and a Billing Address card (with a “same as shipping” toggle), a collapsible “Order Items (N)” card, a shipment-tier selector (Standard / Express, each with its ETA and price), an Order Summary card (Total Bill → Total Savings, if any → Subtotal → Tax → Shipping → COD Charges, if any → Round Off, if non-zero → Total), and a payment-method selector. A sticky bottom bar shows the running Total alongside a Place Order & Pay button, and a full-screen processing overlay covers the page (blocking back-navigation) while an order submission is in flight.
What the shopper does here
- Changes the shipping or billing address from a bottom sheet — reloads the whole checkout quote afterward, since the resolved address can change which fields come back.
- Toggles “Billing same as shipping”.
- Expands or collapses the Order Items card.
- Picks a delivery tier — applied immediately with no extra network call, since every tier already carries its own quoted price.
- Picks a payment method — this one does re-query the server: switching between Cash on Delivery and prepaid can change the quoted shipment price and COD surcharge together, not just add a flat fee, so the screen shows a brief recalculating state and never leaves a payment method selected without the pricing it implies. A failed recalculation rolls the selection back to the previous method with an error shown.
- Taps Place Order & Pay to submit the order.
How it’s built
One shared GraphQL query backs both checkout entry points. This screen calls shop-service’s getCheckoutDetails with no item parameters — the cart-based path — which is the same query and the same CheckoutController/CheckoutView the Buy Now Checkout screen uses with parameters supplied. getCheckoutDetails resolves one consolidated checkout-info call across every cart line (the same pricing/tax/stock resolution the product-detail screen’s shipment preview uses), builds the price summary, and caches the full resolved aggregate under a freshly minted token before returning it.
That cached aggregate lives in MongoDB with a 1-hour TTL, not Redis — a deliberate, cost-conscious choice reusing the MongoDB server every service already depends on, with an explicit trigger for revisiting it once traffic or latency justifies standing up Redis; see ADR-00026.
The quoted shipment pincode comes from the shopper’s region setting, not the address book. Selecting a different shipping address re-queries the checkout details (to pick up the new address fields), but it no longer changes which shipment tiers get quoted — that was a deliberate fix for the address-book pincode and the region-setting pincode silently disagreeing.
Total Bill and Total Savings are backend-computed and never re-derived client-side; shipping cost, round-off, and the final total stay client-recomputed because they depend on whichever tier is currently selected, using the identical rounding formula the server used for the default tier.
Order placement is real. Tapping Place Order & Pay POSTs a minimal {idempotencyKey, checkoutToken, paymentMethod, courierId} to order-service’s POST /api/v1/order — no address, pricing, or item content is sent, since order-service resolves all of it itself by looking up the cached checkout session behind checkoutToken, so a client can no longer tamper with pricing by editing the request. A retried tap after a network failure reuses the same idempotency key, so order-service dedupes it server-side instead of creating a second order. Order detail retrieval and order history are still a mocked, in-memory flow today — order-service only implements creation.

Related Documents
- BRD-014 — Checkout Review: Address, Delivery, and Payment Selection
- SR-015 — Checkout Review: Address, Delivery, and Payment Selection System Requirements
- BRD-013 — Checkout Completion: Real Payment Capture and Reliable Fulfillment Handoff
- SR-014 — Checkout Completion: Payment Capture & Fulfillment Handoff System Requirements
- shop-service
- order-service
- ADR-00026 — MongoDB TTL Collection vs. Redis for the Checkout-Session Cache
- SR-012 — Reusable Checkout Orchestration: System Requirements
- See also: Buy Now Checkout — same screen, single-item entry point
- Previous: Cart
- Next: Payment Method & Razorpay Payment Flow