flawsnap library
Flawsnap: in-app bug reporting for Flutter, powered by Snaplog.
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await Snaplog.init(apiUrl: 'https://api.example.com/api/v1', projectKey: 'pk_...');
runApp(Snaplog.wrap(const MyApp()));
}
Classes
- ReporterSession
- A signed-in team member's reporter token, as the API returns it.
- ReporterTokenStore
- Where a signed-in member's reporter token is kept between launches.
-
Keeps the token in shared_preferences (v1). The token only lets this app
send reports to one project, but apps that want it encrypted at rest can
pass a store backed by flutter_secure_storage to
Snaplog.init. - Snaplog
- Entry point of the SDK. Call init once, then wrap your app with wrap.
- SnaplogHttpClient
-
An
httpclient that records method, URL, status and timing of each request for bug reports. Request and response bodies are never recorded. - SnaplogLogEntry
- A console-style line attached to reports (mirrors LogEntry in the API).
-
Tracks the current route so reports say which screen the user was on, and
tells Insights about screen changes (for the user-flow view).
Add it to your app:
MaterialApp(navigatorObservers: [Snaplog.navigatorObserver]). - SnaplogNetworkEntry
- One HTTP request seen by SnaplogHttpClient (mirrors NetworkEntry in the API).
Enums
- SnaplogTrigger
- Ways a user can open the bug reporter.