buoy_core library
Buoy devtools core for Flutter.
Provides the desktop-sync client (BuoySyncClient + ToolSyncAdapter), the tool registry contract (BuoyTool), the floating bubble + dial shell (BuoyDevTools), and shared UI/persistence used by tool packages.
Classes
- Buoy
- Global Buoy runtime: tool registry + desktop-sync lifecycle.
- BuoyDevTools
-
Root of the in-app floating menu — the Flutter analog of the RN package's
FloatingDevTools. Mount it once viaMaterialApp.router(builder:)so it wraps the Navigator and survives all route changes: - BuoyDevToolsSettings
-
Persisted tool-visibility preferences — the Dart mirror of the RN
DevToolsSettingsblob (same JSON shape, same storage key, so a future shared backend stays compatible). - BuoyOverlayHost
- A tiny, generic registry of full-screen overlay builders that BuoyDevTools renders in its Stack, above the app child but below the open tool / floating bubble / dial.
- BuoyStorage
-
Persistence for the floating menu, using the same
@react_buoykey names as the RN package. Position writes are debounced (500 ms, RN parity) so drag/animation streams don't hammer the platform channel. - BuoySyncClient
- BuoySyncStatus
- BuoyTheme
-
Floating-menu palette, matching @buoy-gg/floating-tools-core
colors.tsand shared-ui'sbuoyColors(gameUIColors.ts). - BuoyTool
-
A devtool registered in the floating menu — the Dart analog of the RN
package's
InstalledApp. Dart has no runtimerequire(), so unlike RN's auto-discovery, tools are always registered explicitly (same constraint as the sync client'stools:map). - JsModal
- ToolSyncAdapter
- Mirror of the RN ToolSyncAdapter contract. Payloads must be JSON-serializable.
- TouchableOpacity
- RN TouchableOpacity: dims to activeOpacity instantly on press-down and fades back on release. Responds on tap-up with no recognizer delay.
Enums
- BuoySyncState
- Connection state surfaced to the settings modal's DESKTOP SYNC card (mirrors the RN useDesktopSyncStatus states).
- JsModalMode
-
Flutter port of shared-ui's
JsModal— the draggable/resizable tool modal with two modes:
Constants
- defaultBrokerPort → const int
- The shared record's key — devToolsStorageKeys.modal.state().
- syncProtocolVersion → const int
- Dart port of Buoy's device-side sync bridge (@buoy-gg/external-sync). Speaks sync protocol v1 to the Buoy Desktop broker: announces tool capabilities on (re)connect, obeys the watch/backpressure contract, sends throttled snapshots, and executes remote actions.
Properties
-
expandableWindowControlsEnabled
→ ValueNotifier<
bool> -
Global modal behavior flags — the Dart analog of RN's module-global
setExpandableWindowControls()and the AppHost-injectedenableSharedModalDimensionsprop. Applied from persisted settings on boot and live when toggled in the settings modal. iPad-style expandable window controls (RN default: ON for touch).final -
When ON, every JsModal persists mode/size/position to one shared record.
final
Functions
-
applyGlobalModalSettings(
BuoyDevToolsSettings settings) → void
Typedefs
- BuoyToolModalBuilder = Widget Function(BuildContext context, BuoyStorage storage, VoidCallback onClose, VoidCallback onMinimize)
-
Builds a tool's own modal surface (a JsModal). Rendered directly in the
BuoyDevTools stack — the tool positions itself and calls
onCloseto destroy it oronMinimizeto hand it to the host's minimized dock (which re-opens it, restoring geometry from persistence). -
ToolAction
= FutureOr<
Object?> Function(Object? params)