import 'package:flutter/foundation.dart'; /// Backend origin. Override at build time: /// `flutter run --dart-define=API_BASE_URL=https://fin.example.com`. /// On web the default is the page's own origin (Caddy serves app and API together). String apiBaseUrl() { const fromEnv = String.fromEnvironment('API_BASE_URL'); if (fromEnv.isNotEmpty) return fromEnv; if (kIsWeb) return Uri.base.origin; return 'http://127.0.0.1:8000'; }