Skip to content

Customer app

Entry: lib/main_user.dart · Flavor: user · Code: lib/auth/, lib/user/

UserHome listens to Firebase Auth. Signed-out users see the login screen. Signed-in users go to table check-in, then to UserMainWrapper, the bottom-navigation shell with Menu, Cart, Orders, Status and Profile.

Features

Feature What it does
Sign up / log in Email + password or Google Sign-In. New users get a users/{uid} profile document.
QR table check-in Scan the table's QR code (5 or {"table":"5"}) or pick a free table. The table is marked occupied and linked to the user.
Live menu Real-time menu from Firestore, filtered by category and sorted by price, popularity or name. Unavailable items are greyed out.
Item details Description, price, calories, serving size, prep time and ingredients, with quantity controls.
Favourites Like items and see them on the Liked items screen.
Ratings Rate menu items from 1 to 5 stars.
Cart A Firestore-backed cart, kept in sync across screens by CartProvider.
Place orders The cart becomes an order, with an items sub-collection, in a single batched write. Diners can order several times per visit.
Live tracking Each order shows its stage (placed → preparing → ready) and how long ago it was placed.
Bill When every order is ready, they merge into one bill with 5% tax and a sequential ID (bill_0001, …).
PDF & sharing Turn the bill into a PDF, open it on the device, or share a screenshot.
Payment Razorpay Checkout (UPI, card, net banking, wallets). Success updates the order and bill and logs a payment record.
Past orders History of the user's previous bills.

Screen map

flowchart TD
    L["Login / Sign up<br/>auth/login_screen.dart"] --> Q["QR check-in<br/>qr_table_scan_screen.dart"]
    Q --> W["UserMainWrapper"]
    W --> M["Menu<br/>menu_screen.dart"]
    W --> C["Cart<br/>cart_screen.dart"]
    W --> P["Past orders<br/>past_orders_screen.dart"]
    W --> S["Order status<br/>order_status_screen.dart"]
    W --> PR["Profile<br/>profile_screen.dart"]
    M --> D["Item detail<br/>item_detail_screen.dart"]
    M --> LK["Liked items<br/>liked_items_screen.dart"]
    S --> B["Bill<br/>billing/bill_screen.dart"]
    B --> RP["Razorpay<br/>razorpay_payment_screen.dart"]

The full data flow, from cart to payment, is described in Architecture.