buoy_env 0.3.1 copy "buoy_env: ^0.3.1" to clipboard
buoy_env: ^0.3.1 copied to clipboard

Inspect explicitly supplied Flutter environment values and configured requirements, with type checks and status indicators.

example/lib/main.dart

// Buoy env debugger — wiring:
// 1. registerBuoyEnv(vars, requiredEnvVars) seeds the env source (Flutter has no
//    enumerable process.env) and registers the tool + sync adapter.
// 2. BuoyDevTools mounts the in-app menu and starts desktop sync.
import 'package:buoy_env/buoy_env.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';

void main() {
  if (kDebugMode) {
    registerBuoyEnv(
      vars: {
        'API_URL': const String.fromEnvironment('API_URL',
            defaultValue: 'https://api.example.com'),
        'ENVIRONMENT': const String.fromEnvironment('ENVIRONMENT',
            defaultValue: 'development'),
        'DEBUG_MODE': 'true',
      },
      requiredEnvVars: [
        envVar('API_URL').withType('url').build(),
        const RequiredEnvVar.value('ENVIRONMENT', 'production'),
        const RequiredEnvVar.exists('MISSING_TOKEN'),
      ],
    );
  }
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: const Scaffold(
        body: Center(child: Text('Open the Buoy dial → ENV')),
      ),
      builder: (context, child) => BuoyDevTools(
        deviceName: 'My App',
        child: child ?? const SizedBox.shrink(),
      ),
    );
  }
}
0
likes
130
points
385
downloads

Documentation

API reference

Publisher

verified publisherbuoy.gg

Weekly Downloads

Inspect explicitly supplied Flutter environment values and configured requirements, with type checks and status indicators.

Homepage

License

unknown (license)

Dependencies

buoy_core, buoy_shared_ui, flutter

More

Packages that depend on buoy_env