createConfig static method

ErrorTrackingConfig createConfig({
  1. required String dsn,
  2. String environment = 'production',
  3. String? release,
  4. double sampleRate = 1.0,
})

Configure Sentry (requires sentry_flutter package)

Implementation

static ErrorTrackingConfig createConfig({
  required String dsn,
  String environment = 'production',
  String? release,
  double sampleRate = 1.0,
}) {
  return ErrorTrackingConfig(
    enabled: true,
    environment: environment,
    release: release,
    sampleRate: sampleRate,
    onError: (error, stack, context) async {
      // Note: Actual Sentry integration requires sentry_flutter package
      // This is a placeholder for the integration pattern
      debugPrint('Sentry: Would send error to DSN: $dsn');
      debugPrint('Error: $error');
      debugPrint('Context: $context');
    },
    onLog: (message, severity) async {
      debugPrint('Sentry: Would log message: $message ($severity)');
    },
  );
}