How webaddicted/e-commerce-disinfectant works
1. This is a Flutter client application named E-Commerce-Disinfectant. The same Dart codebase targets Android, iOS, and Web, while the android/, ios/, and web/ folders are the platform shells and launch/configuration wrappers around the shared Flutter app.
2. The app entry point is lib/main.dart, with startup wiring likely handled through lib/utils/common/initial_binding.dart and the route constants in lib/utils/constant/routers_const.dart / routes_page.dart. The overall flow appears to start with splash/onboarding, then move into login, then the main home experience.
3. The presentation layer is organized by feature under lib/view/. Each major screen has its own page file: splash, login, home, order, details, profile/setting, notification, wallet, survey, complaint, and list. This makes the app mostly feature-driven rather than layered by UI type alone.
4. Reusable UI pieces live in lib/view/widget/ and are shared across feature screens. These include list/grid tiles, category chips, banner cards, rating display, and carousel dots, which suggests the home and catalog areas are built from composable product and category widgets.
5. Application state and screen logic are separated into lib/controller/. There are controllers for home, login, and a shared base_controller, which strongly suggests a controller-based state management pattern where pages render UI and controllers manage data loading, user actions, and navigation side effects.
6. Data access is split into a small repository layer in lib/data/repo/. base_repo.dart, home_repo.dart, and login_repo.dart isolate data-fetching and persistence operations from UI code. This is the main boundary between screen logic and underlying data sources.
7. The data models under lib/data/common/ represent the app’s core entities: user_info, category_bean, and task_item. These are likely the objects passed between repositories, controllers, and widgets for login state, catalog/category presentation, and task/order-style list content.
8. Networking and remote integration are centralized in lib/utils/apiutils/, with api_base_helper.dart and api_response.dart. The presence of a DIO-based helper in the README means the app is prepared for API-backed flows, even though the repo also contains substantial UI/demo content and dummy data.
9. Local persistence is handled through lib/utils/sp/ using shared preferences helpers and a manager/service split. This is where app-level state such as login/session data, onboarding flags, or cached preferences would be stored and read across launches.
10. Shared cross-cutting utilities sit in lib/utils/common/, including validation, widget helpers, and global utilities. Together with lib/utils/theme/ and the constant files in lib/utils/constant/, this forms the app’s design and behavior layer: colors, strings, assets, routes, preference keys, and dummy content.
11. The app appears to be a retail/catalog experience with multiple user journeys: browsing categories, viewing details, cart/order flow, address entry, profile settings, notifications, wallet, surveys, and complaints. The README screenshots match that structure, so a diagram should show a central commerce/navigation hub branching into those feature modules.
12. Assets are bundled locally under assets/fonts and assets/images, and the UI depends on them for branding and product imagery. There is also a prebuilt apk/app.apk artifact in the repo, indicating the project is distributed with a packaged Android build in addition to source.
13. The repository includes CI/testing scaffolding: .github/workflows/dart.yml for Dart/Flutter automation and test/widget_test.dart for basic widget coverage. The native Android/iOS projects are standard Flutter host projects, mostly infrastructure rather than business-logic owners.
Main entry points: home Home hub · main.dart Main · routes_page.dart Routes · initial_binding.dart Initial binding
Components 33
App layers
Entry, state, data, utilities, and presentation
- Main · Flutter app bootstrap and startup wiring
lib/main.dart - Initial binding · App initialization and dependency setup
lib/utils/common/initial_binding.dart - Routes · Route names and page registry
lib/utils/constant/routes_page.dart - App constants · Assets, strings, colors, prefs, and dummy data
lib/utils/constant - Theme · Shared theme and text styling
lib/utils/theme - Shared utils · Validation, widget helpers, and global utilities
lib/utils/common - Prefs store · Shared preferences helpers and persistence manager
lib/utils/sp - API layer · Remote request helper and response wrapper
lib/utils/apiutils - Base controller · Shared controller behavior and common screen logic
lib/controller/base_controller.dart - Home controller · State and actions for the home experience
lib/controller/home_controller.dart - Login controller · State and actions for authentication flows
lib/controller/login_controller.dart - Base repo · Common repository abstraction
lib/data/repo/base_repo.dart - Home repo · Data access for catalog and home features
lib/data/repo/home_repo.dart - Login repo · Data access for authentication and session flows
lib/data/repo/login_repo.dart - Core models · User, category, and task/order data objects
lib/data/common - Splash flow · Launch and onboarding screens
lib/view/splash - Auth flow · Login, signup, OTP, and password recovery screens
lib/view/login - Home hub · Main browsing and navigation surface
lib/view/home - Order flow · Category, cart, address, and order history screens
lib/view/order - Product details · Item detail view
lib/view/details - Profile · Profile and settings screen
lib/view/setting - Notifications · Notification center screen
lib/view/notification - Wallet · Wallet and payment balance screen
lib/view/wallet - Survey · Survey and feedback screen
lib/view/survey - Complaint · Complaint submission screen
lib/view/complaint - Lists · List and photo listing screens
lib/view/list - Shared widgets · Reusable banners, category chips, grids, ratings, and carousel dots
lib/view/widget
Platform & assets
Native wrappers, bundled assets, and build artifacts
- Android host · Native Android wrapper and launch configuration
android - iOS host · Native iOS wrapper and launch configuration
ios - Web host · Web entry and manifest shell
web - Assets · Bundled fonts and images
assets - APK artifact · Prebuilt Android package
apk/app.apk - CI workflow · Dart/Flutter workflow automation
.github/workflows/dart.yml
Connections 36
- Main → Initial binding: initializes · Bootstraps app services before rendering
- Main → Routes: uses · Starts navigation from route registry
- Main → Theme: applies · Configures shared visual styling
- Main → Splash flow: launches · Entry flow begins at splash/onboarding
- Initial binding → Prefs store: sets up · Initializes persistent app state
- Initial binding → API layer: wires · Prepares networking helpers
- Routes → Splash flow: routes to · Navigation starts with splash flow
- Routes → Auth flow: routes to · Authentication screens are reachable via routes
- Routes → Home hub: routes to · Main commerce hub is a key destination
- Home hub → Shared widgets: composes · Uses reusable catalog and banner widgets
- Home hub → Home controller: driven by · Home state and actions come from controller
- Auth flow → Login controller: driven by · Login and signup logic is controller-backed
- Home controller → Home repo: loads from · Fetches home and catalog data
- Login controller → Login repo: loads from · Handles auth-related data operations
- Home repo → API layer: calls · Uses network helper for remote access
- Login repo → API layer: calls · Uses network helper for remote access
- Home repo → Prefs store: caches · Can persist session or app state locally
- Login repo → Prefs store: caches · Stores auth/session preferences locally
- Home hub → Order flow: navigates to · Home branches into shopping and order flows
- Home hub → Product details: navigates to · Product browsing opens detail view
- Home hub → Profile: navigates to · Home links to profile/settings
- Home hub → Notifications: navigates to · Home links to notifications
- Home hub → Wallet: navigates to · Home links to wallet
- Home hub → Survey: navigates to · Home links to surveys
- Home hub → Complaint: navigates to · Home links to complaints
- Home hub → Lists: navigates to · Home links to listing screens
- Order flow → Core models: uses · Order and category content rely on shared entities
- Product details → Core models: uses · Details render data from shared entities
- Shared widgets → Core models: renders · Widgets present categories, tasks, and product data
- Shared utils → App constants: reads · Helpers depend on shared constants and keys
- CI workflow → Main: verifies · Workflow covers app build and tests
- Android host → Main: hosts · Android shell launches the Flutter app
- iOS host → Main: hosts · iOS shell launches the Flutter app
- Web host → Main: hosts · Web shell launches the Flutter app
- Assets → Shared widgets: supplies · UI widgets consume bundled images and fonts
- APK artifact → Android host: builds for · Packaged Android artifact