Stop Rebuilding.
Start Switching.
The runtime brain for your Flutter app. Swap environments in 0.2 seconds. No rebuild. No hot reload. Just tap, tap, done.
flutter pub add envified1void main() async {2 WidgetsFlutterBinding.ensureInitialized();3 4 // πΏ One-line setup β auto-discovers .env.* files5 await EnvConfigService.instance.init(6 defaultEnv: Env.dev,7 allowProdSwitch: false, // π lock prod by default8 verifyIntegrity: true, // π SHA-256 tamper check9 onAfterSwitch: (config) => {10 debugPrint('Switched to: ${config.baseUrl}');11 },12 );13 14 runApp(const MyApp());15}0.2s Env Switch
Swap devβprod without rebuilding. Ever.
await svc.switchTo(Env.prod);Production Lock
allowProdSwitch: false prevents accidental data disasters.
allowProdSwitch: falseSHA-256 Tamper Detection
Hash every .env file on first launch. Throw on mismatch.
verifyIntegrity: truePIN / Biometric Gate
Face ID or 4-digit PIN before the debug panel opens.
EnvGate(pin: '1234', biometric: true)Encrypted Audit Log
Every switch logged. Capped at 50. Visible in panel.
await svc.auditLogZero Prod Overhead
Entire debug UI tree-shaken in release builds.
enabled: kDebugModeTyped Getters
getBool, getInt, getDouble, getUri, getList β typed.
svc.getInt('TIMEOUT', fallback: 30)Auto-Discovery
Drop .env.dev, .env.prod β envified finds them all.
autoDiscover: trueSmart Restart Detection
Warns when deps need re-init after switch.
svc.restartNeeded.value1// Wrap your app β overlay auto-hides in release2MaterialApp(3 builder: (context, child) => EnvifiedOverlay(4 service: EnvConfigService.instance,5 enabled: kDebugMode,6 gate: EnvGate(pin: '1234', biometric: true),7 trigger: const EnvTrigger.tap(count: 7),8 child: child!,9 ),10)The code is out there.
Judge away.
MIT-licensed. Everything is in the open. The Flutter community gave me a lot and this is how I give back.
πΏ Runtime environment switching for Flutter applications with security in mind.
1dependencies:2 flutter:3 sdk: flutter4 envified: ^3.0.05 6flutter:7 assets:8 - .env.dev9 - .env.prod