watchdog 0.2.0
watchdog: ^0.2.0 copied to clipboard
A Flutter developer toolkit that streams HTTP requests, responses, BLoC lifecycle events, navigation, and app logs to a browser-based DevTools page in real-time.
0.2.0 #
- One-liner startup. New top-level
runWatchLocalAppandrunWatchGlobalAppfunctions replace theensureInitialized + Watchdog.start + Bloc.observer + runAppboilerplate with a single call. TheStateManagementenum controls which observer(s) are wired automatically (none·bloc·riverpod·both). - Global (cloud-only) mode. Set
WatchdogConfig(global: true, cloud: ...)or userunWatchGlobalAppto skip the local localhost server entirely and stream events only to the remote cloud dashboard — ideal for observing devices that aren't physically reachable from your machine. - Device identity. New
WatchdogDevicelets each running app instance declare its device name, app version, platform, and OS version so the cloud dashboard can tell instances apart. - Riverpod support. New
Watchdog.providerObserveris a RiverpodProviderObserverthat streams provider lifecycle and state changes into the same Instances tab as BLoC/Cubit. State management is now optional and pluggable — use BLoC/Cubit, Riverpod, or both. Wire it withProviderScope(observers: [Watchdog.providerObserver], child: ...). Providers get their own colour-coded "Riverpod" category and filter chip. - Dio support. New
Watchdog.dioInterceptorcaptures every Dio request and response and shows it in the Network tab exactly like Chopper — method, URL, headers, body, query params, status code, duration, and errors. Add it withdio.interceptors.add(Watchdog.dioInterceptor). Non-2xx responses are reported with their status code (mirroring Chopper); responseless failures (timeouts, connection refused, cancellation) appear as failed calls. - Simpler startup.
Watchdog.start()now initializes on first use, so a singleawait Watchdog.start(config: ...)call is enough. CallingWatchdog.initialize()separately still works and is fully backward compatible. - Internal: request/response body normalisation is now shared between the
Chopper and Dio interceptors (
BodyParser).
0.1.3 #
- Fix: the CLI was running
adb reversebut should have been runningadb forward.adb reverseexposes host ports on the device, which caused a port collision with the Watchdog server and acannot bind listener: Address already in useerror.adb forwardis the correct direction for reaching a device-side server from the host browser. After upgrading,watchdog openworks end-to-end for Android devices and emulators.
0.1.2 #
- Added a CLI executable (
watchdog) so teammates can open DevTools with a single command. Install once withdart pub global activate watchdog, then runwatchdog opento auto-runadb reverse tcp:8888 tcp:8888(when adb is available) and launchhttp://localhost:8888in the default browser. No more chasing device IPs. - New subcommands:
watchdog forward(port-forward only),watchdog devices(list adb devices),watchdog help,watchdog version. Supports--portand--no-adbflags.
0.1.1 #
- Wiring-time accessors (
chopperInterceptor,routeObserver,blocObserver,socketTracker,logger,bridge) now return safe no-op fallbacks whenWatchdog.initialize()hasn't been awaited yet or when Watchdog is disabled in release builds. Host apps can wire these unconditionally during DI/router setup without worrying about initialization order. - Removed the assertion that previously crashed host apps on misuse.
0.1.0 #
- Initial public release.
- Local DevTools server with HTTP request/response inspection, BLoC lifecycle tracking, navigation observer, WebSocket tracker, and structured logging.
- Single entry point via
Watchdog.initialize()/Watchdog.start(). WatchdogLoggerabstraction for pluggable logging backends.WatchdogDependenciesfor optional dependency injection (logger, clock, id generator).- Optional cloud streaming via
WatchdogCloudConfig. - Init-once safety guard — concurrent
initialize()calls are coalesced. - Replay buffer for late-connecting HTML clients.
- GetIt container scanning via
Watchdog.trackGetIt(). - Auto-wired
Bloc.observeronstart().