sinew_devtools
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
NetworkRecorderandExceptionRecorder: bounded, in memory, newest firstRedaction: hides tokens, passwords and one-time codes in headers, URLs and bodies before anything is stored, extend-onlyFaultRulesandHostOverride, applied inside the auth layer so a forced 401 runs the real refreshDevToolsGate: aconstthat isfalsein 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.
Related packages
Sinew is one architecture for Flutter and Kotlin, released as a set of packages at one version.
Documentation
- Usage docs: sinew.srctool.com
- API reference: pub.dev/documentation/sinew_devtools
- Source and issues: srctool/sinew-dart
- Design and decisions: the Guide
License
Apache 2.0, see LICENSE.
Libraries
- sinew_devtools
- DevTools capture: recorders, redaction, fault rules and host override.