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.
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
http://10.0.2.2:8000 — the emulator's alias for your computer's localhost.http://localhost:8000 — the simulator shares the Mac's network stack.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.
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")
3. Verify the connection
After changing the URL, confirm the app is talking to your backend before going further:
- Run the app
flutter runand open the login screen. - Sign in with a seller account you created in your own admin panel (Admin → Sellers).
- Check the backend log
storage/logs/laravel.logshould show the request, and the seller's dashboard should show your store data — not empty placeholders.
apiPrefix was edited.google-services.json for new-order notifications.