2023-05-03 10:45:10 +00:00
|
|
|
import 'package:firebase_core/firebase_core.dart';
|
|
|
|
import 'package:firebase_crashlytics/firebase_crashlytics.dart';
|
|
|
|
import 'package:flutter/foundation.dart';
|
|
|
|
|
2023-05-11 13:30:18 +00:00
|
|
|
import 'package:lightmeter/firebase_options.dart';
|
2023-05-03 10:45:10 +00:00
|
|
|
|
|
|
|
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;
|
|
|
|
};
|
|
|
|
}
|