flutter_netwatch 0.2.1
flutter_netwatch: ^0.2.1 copied to clipboard
Flutter HTTP inspector — capture Dio/http/Chopper traffic, mask secrets, export cURL/Postman/HAR, replay requests, view stats. Auto-off in release.
Changelog #
0.2.1 #
- Migrated to
SharePlus.instance.share(ShareParams(text: ...))— fixes theShare.sharedeprecation warnings flagged by pub.dev's static analysis. - Minimum
share_plusbumped from>=10.0.0to>=11.0.0(where theSharePlussingleton was introduced). - Fixed a real bug in
NWHttpClient: it was consuming the response stream during capture, leaving the caller with aStreamHasAlreadyBeenListenedToError. Bytes are now buffered once and a freshStreamedResponseis handed back. - Added 70 new unit tests (102 → 137 total). Business-logic line coverage is now 92.7%.
- Added GitHub Actions CI: format, analyze, tests with 90% coverage gate, lower-bound dep compat, publish dry-run.
0.2.0 #
New features #
- GraphQL pretty-print: detect GraphQL operations on the wire, surface the operation name in the transaction list with a
GQLbadge, render the query / variables / data / errors as separate sections in the detail screen. - Stats / analytics screen: live dashboard accessible from the inspector AppBar — total / success / failure / success-rate, avg / p95 / max duration, slowest endpoints, most-failing endpoints, requests-per-host bar chart.
- HAR 1.2 export: one-tap export of any transaction (or all of them) as a HAR file. Drops straight into Chrome DevTools, Charles, Postman, Insomnia, Fiddler.
- Replay request: re-fire any captured request through your existing HTTP client. Register a replayer once with
NetWatch.registerReplayer(NWDioReplayer(dio))and a Replay FAB appears on the detail screen. - Pause notifications: runtime toggle in Settings to silence pop-up banners while keeping NetWatch capturing in the background.
- Success / Failure tabs: inspector now opens with
All / Success / Failuretabs, each with a live count badge. Filter chips still work inside each tab for granular status filtering. NWGraphQLutility class exposed in the public API for custom GraphQL handling.
Fixes #
- Snackbars from inside bottom sheets (cURL, Export, Settings) now render inside the sheet instead of being hidden behind it. New
NWSheetShellwraps each sheet in a localScaffoldMessenger. - Inspector / detail screens render correctly regardless of the host app's color seed: a self-contained NetWatch theme replaces the inherited Material 3 theme that previously made the status badge and Switch invisible against tinted AppBars.
showModalBottomSheet,showDialog, and the cURL / Export sheets now actually open from inside the inspector. Previously they failed silently because the inspector was mounted as a rawOverlayEntrywith noNavigatorancestor; each NetWatch screen now hosts its ownNavigator+HeroControllerScope.- Notification banner duplicate-key crash fixed — when a transaction transitioned from pending to completed, both events were appended with the same
ValueKey. Same-id notifications now update in place.
Breaking #
- Minimum
diobumped from>=4.0.0to>=5.4.0(we useDioException, introduced in dio 5.4). - Minimum
chopperbumped from>=7.0.0to>=8.0.0(we use chopper 8'sChainAPI). share_plusconstraint widened from^10.0.0to>=10.0.0 <14.0.0.
Other #
- Unused
path_providerdependency removed. - Public-API dartdoc coverage raised above 20% (from 17.3%).
- Package description shortened to fit pub.dev's 60–180 char range.
0.1.0 #
Initial release.
- Sealed-class request, response, status, and security models.
- In-memory storage with size cap and ordered access.
- Dio, http, and Chopper interceptors that never throw and never block traffic.
- Sensitive data masking (headers, JSON body, URL query params) with case-insensitive matching.
- Security analysis: HTTPS, HSTS, X-Content-Type-Options, CSP, Basic auth, sensitive query params.
- Exporters: cURL, Postman Collection v2.1 (single or batch), plain-text share.
- Floating draggable bubble with edge-snap and live unseen-request badge.
- Toast-style overlay notifications, max 3 stacked, auto-dismiss.
- Full-screen inspector with status filters, live stream, search, settings sheet.
- Per-transaction detail screen with Request, Response, and Security tabs.
NetWatch.builderwraps the app in its own Overlay — never pushes routes onto the developer's navigator.- Auto-disabled in release builds via
kReleaseMode(interceptors and builder become pass-through).