Flutter

The Flutter project maintains an SDK for Sentry.

Flutter has extensive documentation, which includes a cookbook on how to integrate with Sentry.

You can get the SDK from pub.dev:

dependencies:
  sentry: ">=3.0.0 <4.0.0"

Import SentryClient and capture events:

import 'package:sentry/sentry.dart';

final SentryClient sentry = new SentryClient(dsn: "__PUBLIC_KEY__");

Capture a test exception:

main() async {
  try {
    throw null;
  } catch(error, stackTrace) {
    await sentry.captureException(
      exception: error,
      stackTrace: stackTrace,
    );
  }
}

For more details, please refer to the official Flutter documentation.

On this page