Flutter App Initial Local Setup

Environment Configuration

Per-environment configuration is managed via .env files in assets/env/.

Debug Environment (.env.debug)

For local development, configure assets/env/.env.debug.

Important: For Android Emulator, use localhost combined with adb reverse. This ensures the app behaves exactly like the host environment, avoiding redirect mismatch issues with Supabase Auth.

Run the following command to forward ports:

adb reverse tcp:3000 tcp:3000
adb reverse tcp:54321 tcp:54321
You can skip this step if you are running the app via VS Code’s "Flutter: Debug (Local)" launch configuration, as it automatically runs these commands for you.
assets/env/.env.debug
# Supabase Configuration
# Use localhost (requires adb reverse)
SUPABASE_URL=http://localhost:54321
SUPABASE_ANON_KEY=<your-local-anon-key>

# Stripe
STRIPE_PUBLISHABLE_KEY=<your-stripe-publishable-key>

# Web Dashboard URL
# Used by "Manage Subscription" button to open the web dashboard
# Use localhost (requires adb reverse)
WEB_DASHBOARD_URL=http://localhost:3000/dashboard

Running the App

flutter run

By default, this runs in debug mode using main_debug.dart and loads .env.debug.