How ashwinbicholiya/food-delivery-app works
Project type and purpose
• This is a Flutter-based cross-platform mobile application for food delivery.
• The README confirms it’s a user-facing app demonstrating menu browsing, cart management, ordering, payment, and profile features.
• There is no custom backend code here; instead it relies on external services (e.g., Firebase via google-services.json).
File structure
• Top-level directories:
– android, ios: native platform code and build configurations
– lib: Dart source organized by feature (Restaurant, loginpage, paymentpage, location) plus shared modules (bloc, services, model, widgets, const)
– assets: fonts
– test: automated widget tests
• The lib folder uses the BLoC (Business Logic Component) pattern:
– lib/bloc holds blocs and provider
– lib/services encapsulates CRUD operations, user management, restaurant management
– lib/model defines data structures (fooditem)
– lib/widgets holds reusable UI components
• Configuration: pubspec.yaml for dependencies; google-services.json suggests Firebase integration; AndroidManifest and Info.plist for platform permissions.
README for additional insights
• Describes features (screenshots of menus, login, checkout)
• Points at Flutter ecosystem documentation
a. Main components
1. Mobile Client (Flutter app)
• UI Layer: Screens (firstpage, cart, payment, map)
• BLoC Layer: cartListBloc, listTileColorBloc, provider
• Service Layer: usermanagement, restmanagement, crud (wraps Firebase/REST calls)
• Data Model: fooditem, user, cart items
2. External Services
• Firebase Auth / Firestore / Realtime Database (from google-services.json)
• Payment gateway SDK (in paymentpage/debit_card.dart)
• Service (in location/map.dart)
3. Platform SDKs
• Android and iOS host apps and permissions
b. Relationships and interactions
• UI components dispatch events to BLoCs
• BLoCs call Service Layer methods
• Services interact with Firebase or payment SDKs
• Data flows back through BLoC streams to UI widgets
• View consumes location services via platform channels or plugins
c. Architectural patterns and principles
• Separation of concerns via layered architecture: UI, state (BLoC), data services, models
• Reactive data flow with Streams/Sinks in BLoC
• Dependency injection via custom provider class
• Feature-based modularization in lib (each screen group in its own folder)
d. Key technologies and frameworks
• Flutter (Dart) for UI
• BLoC pattern for state management
• Firebase SDKs for backend services
• Third-party packages (map, payment processing)
– Rectangles (blue) for on-device components: UI, BLoC, Services, Models
– UI → BLoC → Services → External Services → Services → BLoC → UI
– Map UI → Map plugin → Map Service
Detail
• Every major screen or feature module (e.g., LoginPage, RestaurantList, CartPage, PaymentPage, ProfilePage).
• Provider class as the glue for BLoC dependencies.
• Fonts/assets bundle being loaded at app startup.
• How Android and iOS manifests grant permissions (location, internet).