From 3d7a4666edd1fd72692e234e27af8a5cec7d99ac Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Wed, 13 Aug 2025 15:32:34 +0800 Subject: [PATCH] :necktie: Skip the debug mode crashlytics setup --- lib/main.dart | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index f27a4d1..63caf30 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -64,9 +64,10 @@ void main() async { ); // Although previous if case checked this. Still check is web or not // Otherwise the web platform will broke due to there is no Platform api on the web - if (kIsWeb || !Platform.isWindows) { + // Skip crashlytics setup on debug mode to prevent unexpected report to firebase + if ((kIsWeb || !Platform.isWindows) && !kDebugMode) { FlutterError.onError = - FirebaseCrashlytics.instance.recordFlutterFatalError; + FirebaseCrashlytics.instance.recordFlutterFatalError; PlatformDispatcher.instance.onError = (error, stack) { FirebaseCrashlytics.instance.recordError(error, stack, fatal: true); return true;