Overview
Foodlay Customer App is a complete, production-ready food ordering application built with Flutter for Android and iOS.
- A full customer app with authentication, ordering, and tracking
- GoRouter-based navigation with bottom tab dashboard
- Localization, theming, and DI built-in
- Google Maps, Firebase Messaging/Analytics/Crashlytics
Basic Usage
- Launch the app and sign in
- Choose location, browse restaurants, open a page
- Add items to cart, review quantities, checkout
- Select address & payment, confirm order
- Track order status until delivery completes
Requirements
- Flutter 3+
- Dart 3+
- Android Studio or Xcode
- Devices or emulators
Backend Requirements
- PHP ≥ 8.2
- Composer ≥ 2.5
- Node.js ≥ 18.x
- MySQL 8.0+ or MariaDB 10.5+
Setup
Get dependencies
flutter pub get
Generate code
flutter pub run build_runner build --delete-conflicting-outputs
Quick Start
- Open the project in Android Studio or VS Code
- Install dependencies: flutter pub get
- Start an emulator or connect a device
- Run the app: flutter run
Configuration
Firebase
These configuration files contain sensitive credentials. Do not commit them to
source control.
- Android: android/app/google-services.json
- iOS: ios/Runner/GoogleService-Info.plist
- Generate lib/firebase_options.dart via FlutterFire CLI
dart pub global activate flutterfire_cli firebase login flutterfire configure
Android Secrets
- Create android/app/src/main/res/values/secrets.xml
- Keys: google_maps_api_key, facebook_app_id, facebook_client_token
<resources> <string name="google_maps_api_key">YOUR_KEY</string> <string name="facebook_app_id">YOUR_APP_ID</string> <string name="facebook_client_token">YOUR_TOKEN</string> </resources>
Server API Base URL
- Set the server API base URL used to fetch data (root of your Laravel backend)
- Edit lib/config/util/app_constants.dart and set baseUrl to your backend domain
- No trailing slash; endpoints are appended (e.g., /api/v1/...)
- Local development hosts:
- Android emulator → http://10.0.2.2:8000 (or your backend port)
- iOS simulator → http://localhost:8000 (or http://localhost:8888 for MAMP)
- Ensure your backend allows CORS for the app’s origin during development
lib/config/util/app_constants.dart static const String baseUrl = 'https://example.com';
- HTTP client composes requests as baseUrl + endpoint path
- See lib/core/data/api/api_client.dart (Uri.parse(appBaseUrl + uri))
- Optional per-environment base URL:
- Edit lib/core/dependency_injection/dependency_module.dart and switch env in lib/main.dart
lib/core/dependency_injection/dependency_module.dart
@Named('appBaseUrl') @dev String get devBaseUrl => 'https://dev.example.com';
@Named('appBaseUrl') @prod String get prodBaseUrl => 'https://api.example.com';
lib/main.dart
await configureDependencies(env: Environment.prod);
Maps API Key
Restrict keys to your package/bundle and enable required Maps SDKs.
- AndroidManifest.xml:
<application>
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="@string/google_maps_api_key"/>
</application>
- iOS Info.plist:
<key>GMSApiKey</key> <string>YOUR_IOS_API_KEY</string>
Android & iOS Config
- Set application name and ID in project settings
- Configure signing for Android and capabilities for iOS
- Align deployment targets with SDK versions
Localization & RTL
- Localizations wired via AppLocalizations in main.dart
- ARB files under lib/l10n/arb (en, ar, bn, es, hi)
- Access strings using context.l10n helpers
- RTL supported; prefer directional-aware widgets
Theme & Branding
- Edit ThemeData in lib/config/theme/light_theme.dart and dark_theme.dart
- Use CustomThemeColors for global palette
- Declare fonts in pubspec.yaml and reference via theme
- Replace assets under assets/ and configure app icons
Maps API Keys
- Restrict Android key by package name and SHA-1
- Restrict iOS key by bundle identifier
- Enable required Maps SDK APIs in Google Cloud Console
Core Features
- Dashboard tabs: Home, Menu, Cart, Offers, Account
- Onboarding, Splash, Search with filters
- Authentication: password, OTP verification, setup password
- Profile and settings, wishlist
- Address selection and delivery info with Maps
- Checkout and payment (webview-based flows)
- Orders, details, tracking, confirmation
- Wallet, loyalty points, referral
- Notifications (Firebase) and local notifications
- Chat and conversations
- File viewer (images/videos), About/Terms/Privacy/Refund
Architecture
- Routing with GoRouter and custom transitions
- State with Bloc/HydratedBloc; DI via get_it + injectable
- ThemeLocalizationWrapper and GlobalOverlayWrapper
- Firebase initialized in main with NotificationHelper
- Error handling via Catcher2 (debug/release configs)
Routes
- Shell: Dashboard
- Home: /home
- Menu: /menu
- Cart: /cart
- Offers: /offers?tab=0..n
- Account: /account
- Splash: /splash
- Onboarding: /onboarding_screen
- Search Result: /search_result?filters=&query=
- Login: /login
- Forget Password Login: /forget_login
- Set Up Password: /set_up_password?uniqueIdentifier=&otp=
- Verification: /verification?uniqueIdentifier=&isFromOtp=
- Edit Profile: /edit_profile
- Contact Us: /contact_us
- Terms & Condition: /terms_and_condition
- Privacy Policy: /privacy_policy
- Refund Policy: /refund_policy
- FAQ: /faq
- Settings: /settings
- Settings → Setup Password: /settings/settings_setup_password?isUpdated=
- Notification: /notification
- Wishlist: /wishlist
- Wallet: /wallet
- Loyalty Point: /loyalty_point
- Referral: /referral
- Checkout: /checkout
- Checkout → Update Delivery Info: /checkout/update_delivery_info
- Checkout → Address: /checkout/checkout_address?address=&showDeliveryArea=
- Checkout → Personal Info: /checkout/personal_info
- Payment: /payment?amount=
- My Orders: /my_orders
- My Orders → Details: /my_orders/order_details?data=&orderId=&isTrack=
- Order Confirmation: /order_confirmation?orderId=&readableId=&phone=&countryDialCode=
- Chat: /chat
- Chat → Conversation: /chat/conversation?chatName=&chatId=&imageUrl=&isBusiness=
- File Viewer: /file_viewer?data=&initialIndex=
- About Us: /about_us
- Select Location: /select_location
- Recommended View All: /recommended_view_all
- WebView: /webview?data=
Project Structure
- lib/config/route: route_config.dart
- lib/config/theme: light_theme.dart, dark_theme.dart, custom_theme_colors.dart
- lib/config/util: assets.gen.dart, fonts.gen.dart, styles.dart, constants
- lib/core: helpers, DI, notifications, overlays
- lib/features: screens for home, menu, cart, checkout, orders, etc.
- lib/l10n/arb: app_en.arb, app_ar.arb, app_bn.arb, app_es.arb, app_hi.arb
Run and Debug
flutter run
Build and Release
Android
flutter build apk
iOS
flutter build ipa
Signing & Release
- Android: configure keystore and release signing
- Android: complete release checklist before publishing
- iOS: set signing identities and capabilities
- iOS: verify release checklist in Xcode
API Usage
- Use token-based authentication
- Handle pagination for lists
- Use secure storage for sensitive data
Testing
flutter test
Troubleshooting
- Gradle build failed: match Gradle/Android plugin versions
- Flutter SDK path not found: check flutter/bin in PATH
- Dependency resolution failed: run flutter clean then pub get
- iOS deployment target: align Podfile and Xcode target versions
- No matching Firebase client: use correct bundle identifier
- Generated files missing: run build_runner with delete-conflicting-outputs
- google-services.json not found: place at android/app/google-services.json
- Maps key missing: create secrets.xml and add google_maps_api_key