Responsive Flutter client for the CellphoneZ marketplace, enabling shoppers to browse consumer tech products, manage carts, and pay with COD or VNPay while admins curate the catalog, brands, and orders. The app targets both Android and iOS and is backed by Supabase services plus build_runner tooling.
| Home | Product Detail | Cart | Payment |
|---|---|---|---|
![]() |
![]() |
![]() |
![]() |
| Login | Sign Up | Forgot Password |
|---|---|---|
![]() |
![]() |
![]() |
| Admin Products | Admin Categories | Admin Orders |
|---|---|---|
![]() |
![]() |
![]() |
- Table of Contents
- Overview
- Feature Highlights
- Architecture & Tech Stack
- Project Layout
- Getting Started
- Recommended Workflows
- Testing
- Schema & Environment Notes
- Goal: Deliver an end-to-end shopping journey for smartphones, laptops, tablets, and accessories with admin oversight.
- Target users: Customers who discover and purchase devices, and administrators who manage inventory, brands, and fulfillment.
- State management: Mix of
bloc/flutter_blocfor flows,providerfor lightweight shared state, andget_itfor dependency injection. - Back end: Supabase (PostgreSQL + Auth + Storage) with generated clients sourced from
supabase_schema.sql/SCHEMA_GUIDE.md. - Payment: Cash on Delivery and VNPay via the
vnpay_flutterandwebview_flutterpackages.
- Onboarding: Email or phone sign-up/login flows with validation, forgot-password, and persistent sessions.
- Catalog exploration: Category drill-down (phones, laptops, tablets, accessories), keyword search, brand filters, and detailed spec pages with cached images.
- Cart & checkout: Add/update/remove items, automatic subtotals, shipping address selection, and dual payment choices (COD or VNPay).
- Order tracking: Timeline of orders with states such as processing, delivering, delivered, and cancelled; drill into pricing, logistics, and timestamps.
- Account management: Purchase history, profile overview, and secure sign-out.
- Products: Create, edit, or retire products with titles, descriptions, photos, prices, inventory, and assigned categories.
- Categories & brands: Maintain taxonomies (e.g., Laptop, Phone) and brand catalogs (Apple, Samsung, Asus, etc.).
- Orders: Monitor all orders (new, shipping, completed, cancelled) and update fulfillment statuses.
- Framework: Flutter (Dart SDK
>=3.2.0 <4.0.0), Material Design, customPlus JakartaandGrandis Extendedfonts. - State & DI:
bloc,flutter_bloc,provider,get_it,equatable. - Data & Services:
supabase_flutter,freezed+json_serializable,build_runner,logger,http,shared_preferences. - Maps & location:
google_maps_flutter,geolocator,geocodingfor delivery address workflows. - Media & UI:
cached_network_image,image_picker,flutter_svg,animations,curved_navigation_bar. - Payments:
vnpay_flutter+webview_flutterfor VNPay, COD handled in-app.
├── lib/
│ ├── admin/ # Admin dashboards and widgets
│ ├── components/ # Reusable UI building blocks
│ ├── providers/ # Provider-based state holders
│ ├── screens/ # Feature screens per flow
│ └── services/ # Integrations (Supabase, payments, etc.)
├── assets/ # Icons, images, fonts, and illustrations
├── docs/
│ ├── assets/ # Screenshot references used in this README
│ └── … # Additional documentation
├── android/ , ios/ # Platform scaffolding
├── supabase_schema.sql # Source of truth for DB schema
├── SCHEMA_GUIDE.md # Schema documentation and conventions
├── PRM392_CellPhoneZ.md # Vietnamese requirement specification
├── melos.yaml / gen.sh # Build_runner & workspace tooling
└── README.md # You are here
- Flutter SDK 3.2+ with Dart 3.
- Xcode (iOS) / Android SDK (Android) and device/emulator setup.
- Melos (
dart pub global activate melos) for workspace orchestration. - Supabase project + credentials, VNPay sandbox keys.
- Install dependencies:
flutter pub get. - Copy
.envfrom the secure vault, populate Supabase URL/anon keys, VNPay credentials, and any Google Maps keys (never commit secrets). - Generate code when models or schema change:
melos run gen. - Start a dev session with hot reload:
melos run run. - Build a release APK when ready:
melos run build-apk.
- Analyzer & formatting:
melos run analyzeandmelos run format(two-space indentation enforced byanalysis_options.yaml/flutter_lints). - Cleaning stale artifacts:
melos run cleanbefore switching branches or when generated code drifts. - Assets & naming: Use
snake_casefor asset filenames,UpperCamelCasefor types, and group feature-specific widgets underlib/screens/<feature>/. - CI-friendly steps: Run
melos run test,melos run analyze, andmelos run build-apklocally before opening a PR. - Commits: Follow Conventional Commits (e.g.,
feat: add VNPay checkout). Keep subject lines<72chars and mention ticket IDs when relevant.
- Place widget/unit tests under
test/using<feature>_test.dartnaming, e.g.,cart_summary_test.dart. - Execute the full suite via
melos run test. - Add golden references for UI snapshots in
test/goldens/and keep descriptive filenames (e.g.,home_grid_dark.png). - Extend coverage whenever you introduce new flows (checkout, admin management, etc.) or modify service integrations.
- Update
supabase_schema.sqlplusSCHEMA_GUIDE.mdwhenever the data model changes. - After schema edits, run
melos run gento refresh generated clients/Freezed models. - Document migrations under
docs/and coordinate Supabase migrations with backend teammates. - Keep
.envand other secrets out of source control; leverage the secure vault when sharing configs. - Map features rely on
MAPTILER_API_KEYin.env; without it the Store Locator/admin maps will show a placeholder instead of loading tiles.
Need clarifications or more screenshots? Check docs/assets/ for the full catalog or open an issue/PR describing the additions. Happy shipping!










