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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
/// Shared app theme, aligned with the visual tone of the reference templates.
|
||||
class AppTheme {
|
||||
AppTheme._();
|
||||
|
||||
static const Color background = Color(0xFFEDF0F2);
|
||||
static const Color surface = Color(0xFFFFFFFF);
|
||||
static const Color primary = Color(0xFF253840);
|
||||
static const Color accent = Color(0xFF00B6F0);
|
||||
|
||||
/// Builds the Material [ThemeData].
|
||||
static ThemeData light() {
|
||||
final ColorScheme colorScheme = ColorScheme.fromSeed(
|
||||
seedColor: primary,
|
||||
primary: primary,
|
||||
secondary: accent,
|
||||
surface: surface,
|
||||
brightness: Brightness.light,
|
||||
);
|
||||
|
||||
return ThemeData(
|
||||
useMaterial3: true,
|
||||
colorScheme: colorScheme,
|
||||
scaffoldBackgroundColor: background,
|
||||
appBarTheme: const AppBarTheme(
|
||||
centerTitle: false,
|
||||
backgroundColor: surface,
|
||||
foregroundColor: primary,
|
||||
elevation: 0,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user