flutter_env_switch 1.1.0
flutter_env_switch: ^1.1.0 copied to clipboard
A lightweight, type-safe runtime environment & config switcher for Flutter apps. Supports multi-.env file loading, enum-driven switching, persistence, a gesture-triggered debug panel, and optional Dio [...]
1.1.0 #
- Tap-count trigger —
EnvSwitchergainstriggerMode(EnvTriggerMode.longPress|EnvTriggerMode.tapCount),tapCount(default 5), andtapWindowMs(default 3000) for the industry-standard hidden-panel gesture. onSwitchedcallback —EnvSwitcherandshowEnvDebugPanelnow accept an optionalVoidCallback? onSwitchedfired after each successful environment switch.- In-panel key browser — the debug panel includes a collapsible "View loaded keys"
section that enumerates all key/value pairs for the active environment. Sensitive keys
(containing
KEY,SECRET,TOKEN, etc.) are masked by default with an eye-toggle. All values can be copied to clipboard. EnvBadge<E>— new overlay widget that renders a persistent environment indicator badge in a corner of its child, reacting automatically to runtime switches.Env.currentEnvData— new static getter exposing all key/value pairs for the current environment as an unmodifiableMap<String, String>.EnvManager.currentEnvData— same, on the typed singleton.
1.0.0 #
- Locked environments — new
lockedEnvironmentsparameter onEnv.initprevents switching away from sensitive environments (e.g. production) at runtime. Env.isLockedstatic getter andEnvManager.isCurrentLockedfor programmatic checks.EnvSwitchLockedExceptiontyped exception thrown when a locked-env switch is attempted.- Debug panel renders a
LOCKEDbadge and disables all environment tiles when locked. - Restart-after-switch toggle is hidden in the panel when the environment is locked.
0.1.0 #
- Initial release.
- Multi-.env file loading from Flutter asset bundle.
- Enum-driven, type-safe environment switching.
- Runtime switching with
SharedPreferencespersistence. - Gesture-triggered debug panel (long-press bottom sheet).
AppRestarterfor soft app restart viaUniqueKey.EnvSwitcherwidget wrapper — automatically disabled in release mode.- Optional
EnvDioInterceptorfor Dio base URL injection. ValueNotifier-based reactive current-environment broadcasting.- Full unit and widget test suite.