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.

buoy_env #

Inspect environment values you supply and validate their types or expected values.

Requirements #

Use a Flutter debug build and a Free or Pro Buoy account key. These packages require Dart 3.9 or later, below 4.0, and Flutter 3.27 or later; your Flutter installation must satisfy both constraints. The Buoy widget does not start its tools in profile or release builds, including with Pro.

Install and register #

flutter pub add buoy_env

This example registers the standalone package. In an existing app, keep your screens and providers and apply the registration and builder changes to that app. Complete the tool-specific integration below before testing capture.

import 'package:buoy_env/buoy_env.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';

void main() {
  WidgetsFlutterBinding.ensureInitialized();
  if (kDebugMode) registerBuoyEnv();
  runApp(const MyApp());
}

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      builder: (context, child) => BuoyDevTools(
        licenseKey: const String.fromEnvironment('BUOY_KEY'),
        child: child ?? const SizedBox.shrink(),
      ),
      home: const Scaffold(body: Center(child: Text('Buoy test app'))),
    );
  }
}

Get a key from your Buoy account, then run:

flutter run --dart-define=BUOY_KEY=YOUR_LICENSE_KEY

If you already use the buoy umbrella, it registers the panel; keep its builder and complete the app integration below. For a complete umbrella setup, see the Flutter Quick Start.

Supply your values #

Flutter does not expose an enumerable map of dart-define values. Pass each value explicitly. Replace the registration call in the startup example with:

registerBuoyEnv(
  vars: {
    'API_URL': const String.fromEnvironment('API_URL'),
    'ENVIRONMENT': const String.fromEnvironment('ENVIRONMENT'),
  },
  requiredEnvVars: [
    envVar('API_URL').withType('url').build(),
    RequiredEnvVar.value('ENVIRONMENT', 'development'),
  ],
);

Run with the matching --dart-define=API_URL=... and --dart-define=ENVIRONMENT=development arguments as well as BUOY_KEY. The required-variable list accepts RequiredEnvVar objects, not bare strings.

If your app uses flutter_dotenv, load it first and pass dotenv.env as vars. That package and loading code belong to your app. Only expose configuration values that your testers are allowed to inspect.

Check the integration #

Supply a known value and a deliberately missing required key. Check their status in Env; registering the tool without a values map does not discover dart-define values.

Desktop and MCP #

Open Buoy Desktop, sign in, and select the connected device. The default broker port is 42831. The iOS Simulator uses localhost; the Android emulator maps localhost to its host address. For a physical device, set socketUrl: 'http://YOUR_COMPUTER_LAN_IP:42831' on BuoyDevTools and use a network that can reach your computer.

MCP needs separate process account configuration and Pro access. Remote capabilities depend on each tool's adapter. Account validation makes network requests, and device sessions can cross your LAN. See Telemetry for data-flow details.

Full Env guide

License #

Proprietary software. © Buoy LLC. See the Terms of Service and pricing.

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