EnvService class

Service class for managing environment configurations

Properties

currentBaseUrl String
Get current base URL
no setter
currentEnvironment Environment
Get current environment
no setter
currentEnvironmentName String
Get current environment name
no setter
environments Map<String, Environment>
Get all available environments
no setter
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addEnvironment(Environment environment) Future<void>
Add a new environment
clear() Future<void>
Clear all saved data
getConfigValue<T>(String key) → T?
Get configuration value from current environment
getEnvironment(String envName) Environment?
Get environment by name
hasEnvironment(String envName) bool
Check if environment exists
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeEnvironment(String envName) Future<void>
Remove an environment
resetToDefaults() Future<void>
Reset to default environments
setConfigValue(String key, dynamic value) Future<void>
Set configuration value for current environment
setEnvironment(String envName) Future<void>
Set current environment
toString() String
A string representation of this object.
inherited
updateEnvironment(String envName, Environment updatedEnv) Future<void>
Update an existing environment

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

instance EnvService
Get singleton instance
no setter

Static Methods

initialize({String? developmentUrl, String? productionUrl, String? stagingUrl}) Future<void>
Initialize the service with SharedPreferences