Overview
Invenicum uses environment variables and compile-time constants to configure API connectivity, timeouts, and core application settings. These settings are defined inlib/config/environment.dart.
Environment Variables
string
default:"http://192.168.1.43:3000"
Base URL for the backend API server. This can be overridden at compile time using the
--dart-define flag.Example:Application Constants
These constants are defined inlib/config/environment.dart:7-31 and cannot be changed at runtime.
General Settings
Documentation URLs
Network Timeouts
int
default:"15000"
Connection timeout in milliseconds (15 seconds). Used when establishing initial connection to the API server.
int
default:"45000"
Response timeout in milliseconds (45 seconds). Maximum time to wait for a response after connection is established.
API Endpoints
Authentication endpoints relative tobaseUrl:
Storage Keys
Configuration Usage
Access environment configuration in your code:Build Configurations
You can create different configurations for development, staging, and production:Best Practices
The
Environment class uses const values for compile-time optimization, meaning values cannot be changed at runtime.Related Files
- Environment Config:
lib/config/environment.dart:1-32 - API Service:
lib/data/services/api_service.dart - Preferences Service:
lib/data/services/preferences_service.dart
