Skip to main content

flutter_api_traffic_inspector 0.3.0 copy "flutter_api_traffic_inspector: ^0.3.0" to clipboard
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 InspectorRedactor shared by all adapters; new config maxBodyChars, maxCapturedBodyBytes, maxWebSocketPayloadChars.
  • Bug fixes
    • "Network Err" filter returned every record when SQLite was enabled.
    • Adapters captured ApiInspector.controller/config when constructed, so anything created before ApiInspector.initialize recorded into an orphaned controller (and ignored enabled: false). They are now resolved per call.
    • ApiInspector.initialize: enabled: false no 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 (no MediaQuery needed); ApiInspector.open honors enabled.
    • http adapter: 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 rewrote content-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; to is now inclusive everywhere.
    • Pushed detail screens now follow the inspector's light/dark choice.
    • JsonViewer match counter was wrong for queries containing regex characters.
    • WebSocket: frames are recorded even when stream is listened to late; sink.addError no 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 path dependency; added topics; documented the exported models; README claims corrected.

0.2.0 #

  • WebSocket Inspector:
    • New InspectedWebSocketChannel (wraps web_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).
  • 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.changes stream.

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 Dio integration via ApiInspectorDioInterceptor supporting requests, responses, errors, timeouts, and cancellations.
    • Standard Dart http.Client wrapper via ApiInspectorHttpClient supporting GET, POST, PUT, PATCH, and DELETE.
  • 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.
  • Developer Interface:
    • Draggable floating debug bubble with live call counter and error alert indicators.
    • ApiInspectorOverlay wrapper 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.
1
likes
150
points
1.14k
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A developer-friendly HTTP and WebSocket traffic inspector for Flutter with a real-time tabbed UI, Dio & http support, and SQLite persistence.

Repository (GitHub)
View/report issues

Topics

#networking #debugging #http #websocket #developer-tools

License

MIT (license)

Dependencies

dio, flutter, http, sqflite, stream_channel, web_socket_channel

More

Packages that depend on flutter_api_traffic_inspector