switchTo static method

Future<void> switchTo(
  1. Enum env
)

Switches the active environment to env and persists the selection.

Throws EnvSwitchLockedException when the current environment is locked. Throws ArgumentError if env was not registered during init. Call AppRestarter.restart separately if you need a full widget-tree rebuild, or use EnvSwitcher which handles this automatically.

Implementation

static Future<void> switchTo(Enum env) async {
  await EnvManager.instance.switchTo(env);
}