Environment Inspector

The Environment Inspector lets you view and validate environment config in your Flutter app — required-variable checks, type detection, per-variable status badges, and a 0–100% health score.

Environment Overview

Environment Overview

See all env vars at a glance with health score. Quickly spot missing, invalid, and misconfigured variables.

Installation

sh
flutter pub add buoy_env
flutter pub add buoy_env

Registration

Flutter has no enumerable process.env--dart-define values are compile-time and can't be listed at runtime. So instead of auto-discovery, you hand Buoy the map explicitly:

dart
import 'package:buoy_env/buoy_env.dart';

registerBuoyEnv(
  vars: {
    'API_URL': const String.fromEnvironment('API_URL'),
    'ENVIRONMENT': const String.fromEnvironment('ENVIRONMENT'),
    // ...any runtime config strings
  },
  requiredEnvVars: [
    envVar('API_URL').withType('url').build(),
    RequiredEnvVar.value('ENVIRONMENT', 'production'),
    'FEATURE_FLAG', // existence check
  ],
);
import 'package:buoy_env/buoy_env.dart';

registerBuoyEnv(
  vars: {
    'API_URL': const String.fromEnvironment('API_URL'),
    'ENVIRONMENT': const String.fromEnvironment('ENVIRONMENT'),
    // ...any runtime config strings
  },
  requiredEnvVars: [
    envVar('API_URL').withType('url').build(),
    RequiredEnvVar.value('ENVIRONMENT', 'production'),
    'FEATURE_FLAG', // existence check
  ],
);

The envVar Builder

The same fluent builder API as React Native:

dart
envVar('API_KEY')
  .withType('string')          // Set expected type
  .withValue('sk_test_123')    // Or set expected value
  .withDescription('API Key')  // Add documentation
  .build()                     // Finalize config

// Shorthand for just checking existence
envVar('API_KEY').exists()
envVar('API_KEY')
  .withType('string')          // Set expected type
  .withValue('sk_test_123')    // Or set expected value
  .withDescription('API Key')  // Add documentation
  .build()                     // Finalize config

// Shorthand for just checking existence
envVar('API_KEY').exists()

Features

  • Required Variable Validation — Define which vars must exist with expected values/types
  • Type Detection — Auto-detects: string, number, boolean, array, object, url, json
  • Search & Filtering — Real-time search + filters for "All", "Missing", "Issues"
  • Health Status — Health percentage (0–100%) with HEALTHY/WARNING/ERROR/CRITICAL states
  • Statistics — Total count, required count, missing count, wrong value/type counts
  • Copy to Clipboard — Copy any value with one tap

Variable Status Types

StatusDescription
required_presentRequired var is set and correct
required_missingRequired var is not set
required_wrong_valueSet but doesn't match expected value
required_wrong_typeSet but wrong type
optional_presentOptional var that is set

Validation Visual Indicators

  • Green — Variable exists and matches expected value/type
  • Yellow — Variable exists but value/type differs from expected
  • Red — Required variable is missing

What's Next