sinew_devtools

pub package License Docs

DevTools capture: recorders, redaction, fault rules and host override.

What a tester needs to see and break the app: every request and exception recorded with secrets already hidden, faults that force a status or drop a connection, and a host that can be switched. This package is the capture; sinew_devtools_ui is the overlay. A production build contains neither.

Features

  • NetworkRecorder and ExceptionRecorder: bounded, in memory, newest first
  • Redaction: hides tokens, passwords and one-time codes in headers, URLs and bodies before anything is stored, extend-only
  • FaultRules and HostOverride, applied inside the auth layer so a forced 401 runs the real refresh
  • DevToolsGate: a const that is false in production, so the compiler removes every devtools entry point from the build

Getting started

flutter pub add sinew_devtools

Usage

void main() {
  DevToolsGate.assertMatchesFlavor();
  runApp(DevToolsGate.enabled ? SinewDevTools(child: const App()) : const App());
}

Build with --dart-define=SINEW_FLAVOR=staging for devtools in a release build. A production build, or one with no define, has none. CI proves it by searching the compiled output for a marker string.

Sinew is one architecture for Flutter and Kotlin, released as a set of packages at one version.

Documentation

License

Apache 2.0, see LICENSE.

Libraries

sinew_devtools
DevTools capture: recorders, redaction, fault rules and host override.