Flutter with AllStak

Capture crashes, errors, and performance from your Flutter app on iOS and Android with the AllStak Flutter SDK.

Source repository:
AllStak/allstak_flutter
Source README:
README.md
SDK version:
1.1.0
Installation source:
pub.dev (package: allstak)
Last verified:
2026-05-31

Installation

Add the package (published on pub.dev as allstak).

flutter pub add allstak

Configuration

Wrap your app with AllStak.runApp, passing an AllStakConfig and your runApp call. This installs error and native crash handling automatically.

import 'package:allstak/allstak.dart';
import 'package:flutter/material.dart';

void main() {
  AllStak.runApp(
    const AllStakConfig(
      apiKey: String.fromEnvironment('ALLSTAK_API_KEY'),
      environment: 'production',
      release: String.fromEnvironment('ALLSTAK_RELEASE'),
      service: 'mobile',
    ),
    () => runApp(const MyApp()),
  );
}

Basic example

Once AllStak.runApp wraps your app, Flutter framework errors and uncaught zone errors are captured automatically (native crash capture is on by default).

Capturing errors

Capture handled exceptions via the AllStak instance.

await AllStak.instance?.captureException(
  StateError('checkout failed'),
  stackTrace: StackTrace.current.toString(),
  context: {'screen': 'checkout'},
);

Tracking requests

With enableHttpOverrides (default true) the SDK installs a process-wide HttpOverrides so HttpClient calls are auto-instrumented. You can also use an explicit instrumented client.

final client = AllStak.instance!.httpClient();
final response = await client.get(Uri.parse('https://api.example.com/orders'));

Best practices

  • Use AllStak.runApp so framework and async errors are captured.
  • Provide the API key at build time via String.fromEnvironment, not hardcoded.
  • Set release to track crash-free sessions per version.