flutter_api_traffic_inspector 0.3.0
flutter_api_traffic_inspector: ^0.3.0 copied to clipboard
A developer-friendly HTTP and WebSocket traffic inspector for Flutter with a real-time tabbed UI, Dio & http support, and SQLite persistence.
0.3.0 #
Requires Flutter 3.27+ / Dart 3.6+ (the UI already used Color.withValues; the constraint now says so). Minimum dio is now 5.2.0 (DioException).
- New features
- Dashboard pagination (infinite scroll), debounced search, and summary tiles/tab badge backed by SQL aggregates (total, errors, average time) instead of the first 50 rows.
- Per-call actions (long-press): copy cURL, copy JSON, replay, delete.
- Export the filtered list as JSON or HAR 1.2 (
RecordExporter,InspectorController.getAllMatching). RequestDetailsScreen(controller: ...)follows a call live and offers Replay (RequestReplayer).- WebSocket history is persisted in SQLite (schema v2, migrated automatically from v1) and masked like HTTP traffic.
- New
InspectorRedactorshared by all adapters; new configmaxBodyChars,maxCapturedBodyBytes,maxWebSocketPayloadChars.
- Bug fixes
- "Network Err" filter returned every record when SQLite was enabled.
- Adapters captured
ApiInspector.controller/configwhen constructed, so anything created beforeApiInspector.initializerecorded into an orphaned controller (and ignoredenabled: false). They are now resolved per call. ApiInspector.initialize:enabled: falseno longer opens a database; a caller-supplied controller now gets the repository; re-initializing disposes the previous controller; database failures are logged instead of silently swallowed.- Overlay: a failed push no longer leaves the dashboard permanently unopenable; the app's text direction (RTL) is respected; works above
MaterialApp(noMediaQueryneeded);ApiInspector.openhonorsenabled. httpadapter: responses are streamed instead of fully buffered (SSE/streaming work); a mid-body error now marks the record as failed; a failure while building the record can no longer break the request; the forwarded request is no longer cloned (which rewrotecontent-type); repeated query keys are kept; HTTP 1xx/3xx are no longer reported as errors.- Dio adapter: real error message/details kept (not just the type name); embedded path query strings recorded and masked; non-http(s) URLs no longer drop the record; byte responses summarised; real response size; the in-flight map can no longer leak.
- Memory: in-memory records are capped; counts are cached so the floating button no longer rescans every record on every event; WebSocket counters are O(1); active WebSocket sessions are never evicted before finished ones.
- Search:
%/_in the search text matched everything in SQLite; SQLite search now also matches the method, like the in-memory search. - Date filter: the end date moved forward a day each time the picker was reopened;
tois now inclusive everywhere. - Pushed detail screens now follow the inspector's light/dark choice.
JsonViewermatch counter was wrong for queries containing regex characters.- WebSocket: frames are recorded even when
streamis listened to late;sink.addErrorno longer marks the session failed; sizes are UTF-8 bytes. - cURL export is shell-safe and includes the query string.
- Security
- Masks form-encoded bodies, JSON-in-string bodies (including truncated JSON), WebSocket URLs/payloads/sub-protocols, URL user-info; broader default header/field lists; case-/separator-insensitive matching plus built-in credential patterns.
- Maintenance
- Removed unused
pathdependency; addedtopics; documented the exported models; README claims corrected.
- Removed unused
0.2.0 #
- WebSocket Inspector:
- New
InspectedWebSocketChannel(wrapsweb_socket_channel) records connection state, sent/received frames, binary payloads, close code/reason and errors. - New WebSocket tab with session cards and a chat-style message view (sent vs received, All/Sent/Received filter, long-press to copy).
- WebSocket history is kept in memory (default: 1000 messages per session, 50 sessions).
- New
- UI Improvements:
- Dashboard now has HTTP / WebSocket tabs with counts.
- Added summary tiles (Total, Errors, Avg time / Sessions, Active, Messages).
- Bug Fixes:
- Floating button call count and error badge now reset immediately after clearing or deleting history.
- Clear history now also clears WebSocket sessions.
- Added
InspectorController.changesstream.
0.1.1 #
- Bug Fixes & Enhancements:
- Fixed multiple popup issue: prevented multiple dashboard screens from opening when tapping the floating button repeatedly.
- Fixed filter deselection: resolved issue where deselecting HTTP method and status category chips did not clear active filters.
- Added response body preview: the Overview tab in the request details screen now displays the response body at the bottom for quick inspection without switching tabs.
0.1.0 #
- Initial production release of
flutter_api_traffic_inspector. - Core & Security:
- Comprehensive sensitive data masking for headers, query parameters, and nested JSON body fields.
- Fail-safe execution boundaries ensuring networking is never interrupted by inspector operations.
- Binary payload detection and large response body truncation safeguards.
- Network Adapters:
- Full
Diointegration viaApiInspectorDioInterceptorsupporting requests, responses, errors, timeouts, and cancellations. - Standard Dart
http.Clientwrapper viaApiInspectorHttpClientsupporting GET, POST, PUT, PATCH, and DELETE.
- Full
- SQLite Persistence:
- Schema migrations, structured CRUD, and transaction querying backed by
sqflite. - Bounded history retention with automatic oldest-first pruning (default: 500 records).
- Filter criteria support: HTTP method, status code category, date range, and URL search.
- Schema migrations, structured CRUD, and transaction querying backed by
- Developer Interface:
- Draggable floating debug bubble with live call counter and error alert indicators.
ApiInspectorOverlaywrapper with intelligent navigator resolution.- Developer Dashboard UI with real-time stream updates and theme mode toggle (light/dark/system).
- Request Details screen featuring pretty-printed JSON viewer, in-viewer search, and one-click cURL export.
- Example Application:
- Real-world DummyJSON Products store app with Cubit state management, 2-column GridView, infinite scroll pagination, and live inspection.