m3_lightmeter/lib/firebase.dart
Vadim 6232ad555a
ML-51 Integrate Crashlytics (#52)
* added crashlytics

* added firebase_options to CD

* Version bump

* added firebase_options to CI

* timeout
2023-05-03 12:45:10 +02:00

14 lines
548 B
Dart

import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_crashlytics/firebase_crashlytics.dart';
import 'package:flutter/foundation.dart';
import 'firebase_options.dart';
Future<void> initializeFirebase() async {
await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform);
FlutterError.onError = FirebaseCrashlytics.instance.recordFlutterFatalError;
PlatformDispatcher.instance.onError = (error, stack) {
FirebaseCrashlytics.instance.recordError(error, stack, fatal: true);
return true;
};
}