buoy_core 0.3.0 copy "buoy_core: ^0.3.0" to clipboard
buoy_core: ^0.3.0 copied to clipboard

Buoy devtools core for Flutter — desktop-sync client (Buoy Desktop broker protocol), tool registry contract, floating bubble + dial shell, and persistent settings storage.

example/lib/main.dart

// buoy_core: the floating devtools shell + a custom tool synced to the
// Buoy Desktop dashboard. Register tools with Buoy; BuoyDevTools starts the
// desktop connection automatically on mount.
import 'package:buoy_core/buoy_core.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';

int _count = 0;
final _listeners = <void Function()>[];

void main() {
  if (kDebugMode) {
    // Any object exposing getSnapshot/subscribe/actions can sync to desktop.
    Buoy.registerTool(
      BuoyTool(
        id: 'counter',
        name: 'Counter',
        color: const Color(0xFF34D399),
        icon: Icons.plus_one,
        onPressed: (context) {
          _count++;
          for (final l in List.of(_listeners)) {
            l();
          }
        },
      ),
      adapter: ToolSyncAdapter(
        version: 1,
        getSnapshot: () => {'count': _count},
        subscribe: (onChange) {
          _listeners.add(onChange);
          return () => _listeners.remove(onChange);
        },
        actions: {'reset': (_) => _count = 0},
      ),
    );
  }
  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('Your app'))),
      builder: (context, child) => BuoyDevTools(
        deviceName: 'My App',
        child: child ?? const SizedBox.shrink(),
      ),
    );
  }
}
0
likes
150
points
183
downloads

Documentation

API reference

Publisher

verified publisherbuoy.gg

Weekly Downloads

Buoy devtools core for Flutter — desktop-sync client (Buoy Desktop broker protocol), tool registry contract, floating bubble + dial shell, and persistent settings storage.

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, shared_preferences, socket_io_client

More

Packages that depend on buoy_core