Keyboard Shortcuts

j / kScroll down / up
ggScroll to top
GScroll to bottom
/Open search
?Show this help
EscClose search / help
n / NNext / previous section
hGo to landing
dGo to docs
:Command mode — type section name

Press ? or Esc to close

Deep Dives

Environment Config

No .env files committed. No hardcoded base URLs. Configuration is injected at compile time via dart-define.

// config/constants/app_constants.dart
class AppConstants {
  static const baseUrl = String.fromEnvironment(
    'BASE_URL',
    defaultValue: 'https://dev-api.example.com',
  );
}

Run with dart-define

# Single value
flutter run --dart-define=BASE_URL=https://api.example.com

# Full environment file (dev / staging / prod)
flutter run --dart-define-from-file=env/prod.json
// env/prod.json
{
  "BASE_URL": "https://api.example.com",
  "ENV":      "production"
}
sam's arch — A Pragmatic Flutter Architecture