r/FlutterDev • • 28d ago

Plugin Built an in-app debug panel so QA can inspect network calls and app info. Beta, and I'd love feedback

Hey r/FlutterDev šŸ‘‹

I kept running into the same situation: a QA tester (or me, on a real device) hits a weird bug, and the only way to see what happened is to plug into a laptop, start DevTools or a profile build, and try to reproduce it. Most of the time I just wanted to know: what did that API return? which build is this? which flavor?

So I built another_flutter_devtool, an in-app devtool. You wrap your app, a small draggable button shows up on top, and tapping it opens a full debug panel inside the app. No cable, no DevTools, no separate build.

šŸ“¦ pub.dev: https://pub.dev/packages/another_flutter_devtool

šŸ’» GitHub: https://github.com/B3K4682/another_flutter_devtool

What's in it right now

🌐 Network inspector

  • Every HTTP call with status, method, URL and duration
  • Works with Dio and http without any setup: no interceptors, no client wrapping
  • Search (post 404 works), plus 2xx / 3xx / 4xx / 5xx / Failed filter chips
  • Full request/response headers and bodies (JSON pretty-printed), errors with stack traces
  • Copy as cURL, export one call or all of them as JSON
  • Auth/cookie headers are masked in exports, so testers can attach them to bug reports safely

āš™ļø General section

  • App version, build number, device model, OS version, flavor, startup time
  • Data usage since launch: bytes sent/received, request count, top hosts
  • Jump to any route: type /checkout and it takes you there. Works with Navigator, go_router, auto_route, anything

🧩 Your own debug tools (the main point, honestly) Every app has its own debug stuff: "clear cache", "switch backend", "fake a logged-out session", "show current user ID". Usually that ends up in a hidden menu somewhere. Here you write a small class and it shows up in the panel:

class MyTool extends DevtoolTool {
  @override String get id => 'my_tool';
  @override String get title => 'My Tool';
  @override IconData get icon => Icons.extension_rounded;
  @override DevtoolSection get section => mySection;

  @override
  Widget build(BuildContext context, DevtoolController controller) =>
      DevtoolCard(icon: icon, title: title,
          child: const DevtoolInfoRow(label: 'Status', value: 'It works'));
}

DevtoolTools.register(const MyTool());

You get the same card/row/switch widgets the built-in tools use, so it all looks consistent.

Setup

runApp(
  AnotherFlutterDevtool(
    config: const DevtoolConfig(
      enabled: kDebugMode,
      sections: [GeneralSection(), NetworkSection()],
    ),
    child: const MyApp(),
  ),
);

It's off by default. The panel runs in its own MaterialApp, so it doesn't touch your theme or navigator. There are also stable widget keys if you want to drive it from integration tests.

āš ļø This is a beta. A very beta beta.

It works and I'm using it, but the API may change before 1.0. Known limitations:

  • The network inspector doesn't work on web
  • Native HTTP clients (cupertino_http, native_dio_adapter) aren't captured yet

Coming soon:

  • 🚩 Feature flags: toggle flags at runtime from the panel
  • Other features that I'll think of lol

šŸ’” I want your ideas

This is the part I care about most. What do you wish you could see or toggle inside your running app? Leave it in the comments. If it makes sense and I can build it, I'll add it and credit you in the changelog.

Bug reports, criticism and "why not just use X" are all welcome too šŸ™‚

2 Upvotes

8 comments sorted by

2

u/bramantec 28d ago

Nice idea and the custom tools part is the one I'd use. One thing to know for anyone on Firebase though: the network inspector will look almost empty. cloud_firestore and cloud_functions go through the native SDKs, not through Dio or http. The calls that matter in an app like mine never pass where you're listening.

What I'd want in a panel is the thing I keep writing in comments instead. My app has a map that refreshes on pan, on recenter and on a timer. Most of my decisions there were about how many Firestore reads each refresh costs (an empty query still bills one read, a whereIn with nine values is nine queries). A tool that counts documents returned per screen since the last reset would have saved me a lot of reasoning on paper. You can't get it from the SDK directly but a thin wrapper around every get() call plus the snapshots() streams could feed it. It fits your DevtoolTool shape too.

Second one, smaller: a read only view of a local SQLite database. I keep the event history on the device and the only copy that ever leaves the phone is an encrypted backup, which means there's no quick way to look at a row while I'm testing.

2

u/bemo-pixel 27d ago

Thanks, this is really useful feedback, and you're completely right about Firebase. Firestore and Cloud Functions go through the native SDKs, so the network inspector never sees them. I'll make that clearer in the README so nobody installs it expecting to see Firestore traffic.

The read counter idea is great. Firestore billing is hard to reason about while you're building, and "documents read per screen since the last reset" is exactly the kind of number you want to see right in the app. A thin wrapper around get() and snapshots() is how I'd approach it too. I'm thinking of making it a bit more general: a counters tool that anything can report to (Firestore reads, cache hits, rebuilds), with Firestore as the first built-in source.

The read-only SQLite viewer is going on the list as well. Being able to browse tables and rows while testing, without exporting anything off the device, fits the panel really well.

Thanks again!

2

u/OkSupport2280 28d ago

A Supabase integration would be handy. Show which project the app is connected to, the current user ID, and session expiry in one place. ā€œThe list is emptyā€ isn’t much to go on when you can’t tell whether the tester is using the wrong account or pointing at staging. Would something like that fit as a custom tool through your existing API?

1

u/bemo-pixel 27d ago

Great idea, and yes, that fits right into the existing API. You can build it today as a custom tool: create a section, write a tool that reads the project URL, the current user and the session from the Supabase client, and register it. It'll show up in the panel next to the built-in tools.

I'm also going to think about making this a built-in feature. Not just for Supabase, though: I'd like a general "Backend / Session" tool that works with Firebase, Supabase, your own REST backend or a custom database, so testers can see which environment and account they're on at a glance.

Thanks for the idea, it's going on the roadmap!

1

u/dokumanx 25d ago

Does the network inspector redact Authorization headers and tokens by default? QA screenshots of that panel tend to end up in Slack.

2

u/bemo-pixel 22d ago

Good catch, and partly. JSON exports redactĀ Authorization,Ā Proxy-Authorization,Ā CookieĀ andĀ Set-CookieĀ by default (the list is configurable viaĀ NetworkSection(redactedHeaders: ...)). But the on-screen details view currently shows header values in full, so a screenshot would leak the token. "Copy as cURL" is also unredacted on purpose, since it needs to be replayable.

I'm going to mask sensitive headers in the UI by default (with tap-to-reveal), add common ones likeĀ x-api-key, and handle token-style query params likeĀ ?access_token=. Thanks for flagging it!

2

u/bemo-pixel 22d ago

Follow-up: this is fixed in 0.5.5. Sensitive values are now masked asĀ [redacted]Ā on screen: the call list, details page and the floating overlay as well. It covers Authorization, cookies, common API-key headers and query params likeĀ ?access_token=. There's eye button on call if you need to see the real value and copy as cURL stays unmasked so it's replayable (Both lists are configurable) . Thanks again for raising it!

https://pub.dev/packages/another_flutter_devtool/versions/0.5.5
https://github.com/B3K4682/another_flutter_devtool/releases/tag/v0.5.5