← Developer DocsSDK Docs
Flutter SDK
Free and open source (MIT) — published as logtryl_crash on pub.dev. See the SDK Overview page first for how recording actually works.
Install
dependencies:
logtryl_crash: ^0.0.1Quick start
Call init once, as early as possible — the first line of main(), before runApp:
import 'package:logtryl_crash/logtryl_crash.dart';
Future<void> main() async {
await LogtrylCrash.init('YOUR_PROJECT_KEY');
runApp(const MyApp());
}Grab your project key from the project’s Edit page in the Dashboard or Desktop app — see Getting your project key on the SDK Overview page.
Pairing a device
The easiest way in is the built-in LogtrylPairingDrawer widget — a swipe-out drawer with a code-entry UI:
LogtrylPairingDrawer(
edge: PairingDrawerEdge.right,
child: const MyApp(),
);Or drive it yourself with LogtrylCrash.pairDevice(code) / .isPaired() / .unpairDevice().
Recording a handled exception manually
Flag a caught exception as worth including in the active recording, even though it didn’t crash the app:
try {
await riskyOperation();
} catch (e, stack) {
LogtrylCrash.recordHandledError(e, stack);
}This only does anything while a debug recording is active — it’s not general-purpose logging.
If the app crashes during a recording
Restart the app to sync the crash
A crash that happens mid-recording is captured on-device, but only uploads to Logtryl on the app’s next launch. If a tester’s app just crashed, ask them to reopen it once before checking the ticket.
API reference
LogtrylCrash.init(appKey, { apiBaseUrl })— installs fatal-crash capture and configures pairing/polling.appKeyis your project key (see above).LogtrylCrash.recordHandledError(error, [stackTrace])— manually records a caught exception into the active recording.LogtrylCrash.pairDevice(code)/.isPaired()/.unpairDevice()— drive pairing yourself instead of (or alongside)LogtrylPairingDrawer.LogtrylCrash.getPendingCrashReports()/.onCrashReport— read fatal crash reports captured on this device directly, for your own logging/QA needs on top of what Logtryl already shows.
