setEnvironment method
Changes the current environment and reloads configurations.
This will reload all configuration files and merge environment-specific overrides for the new environment.
config.setEnvironment('production');
Implementation
void setEnvironment(String environment) {
_environment.clear();
_environment.write(environment);
_loadConfigurations();
}