watchdog 0.2.0 copy "watchdog: ^0.2.0" to clipboard
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 runWatchLocalApp and runWatchGlobalApp functions replace the ensureInitialized + Watchdog.start + Bloc.observer + runApp boilerplate with a single call. The StateManagement enum controls which observer(s) are wired automatically (none · bloc · riverpod · both).
  • Global (cloud-only) mode. Set WatchdogConfig(global: true, cloud: ...) or use runWatchGlobalApp to 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 WatchdogDevice lets 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.providerObserver is a Riverpod ProviderObserver that 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 with ProviderScope(observers: [Watchdog.providerObserver], child: ...). Providers get their own colour-coded "Riverpod" category and filter chip.
  • Dio support. New Watchdog.dioInterceptor captures 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 with dio.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 single await Watchdog.start(config: ...) call is enough. Calling Watchdog.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 reverse but should have been running adb forward. adb reverse exposes host ports on the device, which caused a port collision with the Watchdog server and a cannot bind listener: Address already in use error. adb forward is the correct direction for reaching a device-side server from the host browser. After upgrading, watchdog open works 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 with dart pub global activate watchdog, then run watchdog open to auto-run adb reverse tcp:8888 tcp:8888 (when adb is available) and launch http://localhost:8888 in 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 --port and --no-adb flags.

0.1.1 #

  • Wiring-time accessors (chopperInterceptor, routeObserver, blocObserver, socketTracker, logger, bridge) now return safe no-op fallbacks when Watchdog.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().
  • WatchdogLogger abstraction for pluggable logging backends.
  • WatchdogDependencies for 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.observer on start().
4
likes
120
points
136
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

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.

Repository (GitHub)
View/report issues

Topics

#devtools #debugging #logging #http-inspector #developer-tools

License

MIT (license)

Dependencies

chopper, dio, flutter, flutter_bloc, flutter_riverpod, get_it, http, shelf, shelf_router, shelf_web_socket, talker, uuid, web_socket_channel

More

Packages that depend on watchdog