setEnvironment static method

void setEnvironment(
  1. String id
)

Set the current environment by ID.

Implementation

static void setEnvironment(String id) {
  final env = _environments[id];
  if (env != null) {
    // Update all environments to have correct isActive
    for (final key in _environments.keys.toList()) {
      final value = _environments[key]!;
      _environments[key] = value.copyWith(isActive: key == id);
    }
    _currentEnvironment = _environments[id];
    _notifyListeners(_currentEnvironment!);
  }
}