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