🛒 Bringo

Seller App

API URL & Maps Key

Two things connect the Seller app to your services: the API base URL (your backend) and a Google Maps key (the store location picker shown during vendor signup).

1. API base URL

Open lib/config/env.dart. Set defaultValue to your own domain:

class Env {
  static const String apiBase = String.fromEnvironment(
    'API_BASE',
    defaultValue: 'https://YOUR_DOMAIN.com',   // ← your live backend
  );

  static const String apiPrefix = '/api/v2/seller';
}

Every seller endpoint is built as apiBase + apiPrefix + path — so a login request goes to https://your-domain.com/api/v2/seller/login. Leave apiPrefix alone unless you have renamed the backend routes.

⚠️
Do not leave a trailing slash on apiBase. This app concatenates the parts directly, so https://your-domain.com/ produces https://your-domain.com//api/v2/seller/login with a double slash. Most servers tolerate it, but some Nginx and WAF configurations return 404 — and it is an awkward bug to spot. Write https://your-domain.com with no trailing slash.

Override at build time

Rather than editing the file for each environment, you can pass the URL in:

# staging build
flutter build apk --release --dart-define=API_BASE=https://staging.your-domain.com

# production build
flutter build appbundle --release --dart-define=API_BASE=https://your-domain.com

A value passed with --dart-define always wins over the defaultValue in the file.

Local development

Android emulator
http://10.0.2.2:8000 — the emulator's alias for your computer's localhost.
iOS simulator
http://localhost:8000 — the simulator shares the Mac's network stack.
Physical phone
Your computer's LAN IP, e.g. http://192.168.1.5:8000, with the phone on the same Wi-Fi. 10.0.2.2 and localhost both fail on a real device.

Start the backend with php artisan serve --host=0.0.0.0 so it accepts connections from the phone, not just from the computer itself.

🔓
Plain http:// is blocked by default on Android 9+ and iOS. It already works for local development because the app ships with a debug-only cleartext exception; your production URL must be https:// with a valid certificate.

2. Google Maps key

The Seller app opens a map when a vendor sets their store location during signup. Without a key the map area renders grey or blank. Create and restrict a key first — see Google Maps — then paste it into both platforms.

Android

android/app/src/main/AndroidManifest.xml, inside <application>:

<meta-data
    android:name="com.google.android.geo.API_KEY"
    android:value="YOUR_ANDROID_MAPS_KEY"/>

iOS

ios/Runner/AppDelegate.swift:

import GoogleMaps
// inside application(_:didFinishLaunchingWithOptions:)
GMSServices.provideAPIKey("YOUR_IOS_MAPS_KEY")
🔒
Restrict each key in Google Cloud — Android by package name + SHA-1, iOS by bundle id — and make sure billing is enabled on the project, or the map loads with a "development purposes only" watermark or stays blank.

3. Verify the connection

After changing the URL, confirm the app is talking to your backend before going further:

  1. Run the app flutter run and open the login screen.
  2. Sign in with a seller account you created in your own admin panel (Admin → Sellers).
  3. Check the backend log storage/logs/laravel.log should show the request, and the seller's dashboard should show your store data — not empty placeholders.
Login hangs, then "connection failed"
Wrong host, or the backend is not reachable from the device. Open the same URL in the phone's browser to confirm.
404 on every request
Usually the trailing-slash double slash above, or apiPrefix was edited.
Login works, all lists empty
You are pointed at a different install than the one holding your data — check staging vs production.
Certificate / handshake error
Self-signed or expired HTTPS certificate. Use a real certificate (Let's Encrypt is free).
👉
Next: Firebase & Push — the Seller app also needs google-services.json for new-order notifications.