Skip to content

It contains code examples that cause syntax errors on Documents and pub.dev changelog #12213

Closed
@yamashita-room-335

Description

@yamashita-room-335

SDK

Flutter SDK

Description

, is missing on Sentry.runZonedGuarded()
https://docs.sentry.io/platforms/flutter/usage/
https://pub.dev/packages/sentry_flutter/changelog

now documents and pub.dev changelog

Sentry.runZonedGuarded(() async {
  WidgetsBinding.ensureInitialized();

  // Errors before init will not be handled by Sentry

  await SentryFlutter.init(
    (options) {
    ...
    },
    appRunner: () => runApp(MyApp()),
  );
} (error, stackTrace) {
  // Automatically sends errors to Sentry, no need to do any
  // captureException calls on your part.
  // On top of that, you can do your own custom stuff in this callback.
});

Suggested Solution

fixed

Sentry.runZonedGuarded(() async {
  WidgetsBinding.ensureInitialized();

  // Errors before init will not be handled by Sentry

  await SentryFlutter.init(
    (options) {
    ...
    },
    appRunner: () => runApp(MyApp()),
  );
}, (error, stackTrace) {
  // Automatically sends errors to Sentry, no need to do any
  // captureException calls on your part.
  // On top of that, you can do your own custom stuff in this callback.
});

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Waiting for: Product Owner

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions