Skip to main content

Requirements

  • Flutter >=3.0.0
  • Dart >=3.0.0

iOS requirements

  • Device with iOS 12+, iPadOS 12+, or Xcode simulator running iOS 16.2+
  • Swift Package Manager (requires opt-in) or CocoaPods 1.16.2+

Android requirements

  • Android 7.0+ device or emulator with Google Play Store (Services) installed

1. Add the dependency

Add lerix_flutter to your pubspec.yaml, plus the optional packages for the features you use:
pubspec.yaml
Keep all three on the same version. The optional packages register themselves before main() runs: there is no extra Dart code to add. An app without lerix_messaging ships without Firebase, the notification permission or the Windows App SDK. Then run:

2. Initialize the SDK

Call Lerix.init() as early as possible — ideally at the top of main() in main.dart. Initialization sets up error monitoring and reporting. It does not initialize push notifications; call Lerix.notifications.init() separately when you need that module.
main.dart
Find your API key and project ID in the Lerix Dashboard under Project Settings.

Parameters

Async initialization

If your builder needs async setup before runApp(), call WidgetsFlutterBinding.ensureInitialized() first:
main.dart

Debug mode

Set debugMode: true during development to print SDK logs to the console:
main.dart

Custom error handler

Use onError to run your own logic when the SDK captures an error — for example, showing a fallback UI or logging to a secondary service:
main.dart

3. Verify the integration

Throw a test error to confirm everything is working:
main.dart
Then open your dashboard — the error should appear within seconds.
You’re all set! Continue to Error Tracking to report custom errors, or Push Notifications to enable push delivery.