error_reporting/error_reporter_example library

Example: Integrating Sentry with Dreamic This file shows how to implement and configure Sentry as an error reporter in a Flutter app using the Dreamic package.

ALL SENTRY INTEGRATIONS REQUIRE 3 STEPS:

  1. configureErrorReporting() - Tell Dreamic to use Sentry
  2. appInitErrorHandling() - Set up Logger integration
  3. Initialize Sentry - Either via SentryFlutter.init or reporter.initialize()

Choose your approach:

  • Approach 1 (RECOMMENDED): SentryFlutter.init with appRunner
  • Approach 2: Manual Sentry integration without appRunner

Functions

exampleMain() → void
APPROACH 2: Manual Sentry integration (for more control) Use this if you need more control over initialization order or want to use the ErrorReporter interface pattern
exampleMainSentryWrapper() → void
APPROACH 1: Using Sentry's recommended SentryFlutter.init() wrapper (RECOMMENDED) This is the RECOMMENDED approach as it lets Sentry manage error handlers
exampleUsage() → void
Example: Custom error reporter for a different service This shows the pattern for implementing any error reporting service Example: Using the error reporter in your app