exampleMainComposite function

void exampleMainComposite()

main() — pass the OR'd config flags across the children you compose (the flags live on ErrorReportingConfig, not on the individual reporters — ERH-007). Any Firebase-dependent child ⇒ requiresFirebase: true; any child that manages its own handlers ⇒ managesOwnErrorHandlers: true. (A Sentry + Crashlytics composite where dreamic owns the handlers ⇒ requiresFirebase: true, managesOwnErrorHandlers: false.)

Implementation

void exampleMainComposite() async {
  /*
  WidgetsFlutterBinding.ensureInitialized();
  installEarlyErrorHandlers();
  if (kWebDartCapture) {
    DreamicErrorHandling.installEarlyWebErrorHandlers(); // Path A′ only
  }

  configureErrorReporting(
    ErrorReportingConfig.customOnly(
      reporter: CompositeErrorReporter([
        SentryErrorReporter(dsn: AppConfig.sentryDsn),
        CrashlyticsErrorReporter(),
      ]),
      enableOnWeb: true,       // Sentry is web-capable; Crashlytics self-guards web
      requiresFirebase: true,  // OR'd: Crashlytics needs Firebase first
      // managesOwnErrorHandlers: false → dreamic installs the handlers.
    ),
  );

  DreamicErrorHandling.runGuarded(() {
    runApp(DreamicAppInitHost(
      initFutureFactory: () => dreamicBootstrap(/* firebaseOptions, hooks, ... */),
      splash: const DreamicSplash(),
      child: const MyApp(),
    ));
  });
  */
  // Reference the primitive so the import is exercised in dreamic-public.
  CompositeErrorReporter; // ignore: unnecessary_statements
}