Skip to content

Commit

Permalink
Fix error log on Windows/Mac
Browse files Browse the repository at this point in the history
  • Loading branch information
w568w committed Apr 29, 2021
1 parent 026f2cf commit 7c3c267
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/util/firebase_handler.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import 'package:catcher/catcher.dart';
import 'package:catcher/model/platform_type.dart';
import 'package:dan_xi/util/platform_universal.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_crashlytics/firebase_crashlytics.dart';
import 'package:flutter/cupertino.dart';
Expand All @@ -25,9 +26,11 @@ class FirebaseHandler extends ReportHandler {
static FirebaseCrashlytics crashlytics;

static initFirebase() async {
await Firebase.initializeApp();
crashlytics = FirebaseCrashlytics.instance;
await FirebaseCrashlytics.instance.setCrashlyticsCollectionEnabled(true);
if (PlatformX.isMobile) {
await Firebase.initializeApp();
crashlytics = FirebaseCrashlytics.instance;
await FirebaseCrashlytics.instance.setCrashlyticsCollectionEnabled(true);
}
}

@override
Expand Down

0 comments on commit 7c3c267

Please sign in to comment.