Scaffold backend gateway and integration docs
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
/// Application-level runtime configuration.
|
||||
class AppConfig {
|
||||
AppConfig._();
|
||||
|
||||
static const String _defaultBaseUrl = String.fromEnvironment(
|
||||
'BACKEND_BASE_URL',
|
||||
defaultValue: 'https://api.example.com',
|
||||
);
|
||||
|
||||
static String? _baseUrlOverride;
|
||||
|
||||
/// Returns the configured backend base URL.
|
||||
static String get backendBaseUrl {
|
||||
final String? override = _baseUrlOverride;
|
||||
if (override != null && override.trim().isNotEmpty) {
|
||||
return override.trim();
|
||||
}
|
||||
return _defaultBaseUrl;
|
||||
}
|
||||
|
||||
/// Enables fake backend implementation for local/offline development.
|
||||
static bool get useFakeBackend =>
|
||||
const bool.fromEnvironment('USE_FAKE_BACKEND', defaultValue: false);
|
||||
|
||||
/// Runtime override for backend URL (e.g. local settings screen).
|
||||
static void overrideBackendBaseUrl(String? baseUrl) {
|
||||
_baseUrlOverride = baseUrl;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user