isLocked property

bool get isLocked

Whether the currently active environment is locked.

When true, any call to switchTo will throw EnvSwitchLockedException. Use this to conditionally show or hide environment-switching UI in your own widgets.

if (!Env.isLocked) {
  await Env.switchTo(Environment.staging);
}

Implementation

static bool get isLocked => EnvManager.instance.isCurrentLocked;