todos-contra-el-fuego-mobile/lib/sentryReport.dart
vjrj 7a4c9fb3bc fix: resolve 2 remaining strict analysis errors
- introPage.dart: Convert fireItems to proper static function closure
- mainDrawer.dart: Convert unreadCount int to String for Text widget
2026-03-06 11:21:06 +01:00

24 lines
569 B
Dart

import 'dart:async';
import 'package:sentry_flutter/sentry_flutter.dart';
import 'globals.dart' as globals;
bool useSentry = !globals.isDevelopment;
Future<void> reportError(dynamic error, dynamic stackTrace) async {
// Print the exception to the console
print('Caught error: $error');
if (!useSentry) {
// Print the full stacktrace in debug mode
print(stackTrace);
return;
} else {
// Send the Exception and Stacktrace to Sentry in Production mode
await Sentry.captureException(
error,
stackTrace: stackTrace,
);
}
}