// No dependencies with anything that needs to be initialized.
await Firebase.initializeApp(options: firebaseOptions);
configureDependencies();
// await getIt<FirebaseAppCheck>().setTokenAutoRefreshEnabled(false);
FlutterError.onError = (errorDetails) {
FirebaseCrashlytics.instance.recordFlutterFatalError(errorDetails);
};
await FirebaseCrashlytics.instance.setCrashlyticsCollectionEnabled(true);
PlatformDispatcher.instance.onError = (error, stack) {
FirebaseCrashlytics.instance.recordError(error, stack);
return true;
};
final remoteConfig = getIt<FirebaseRemoteConfig>();
await remoteConfig.setConfigSettings(RemoteConfigSettings(
fetchTimeout: const Duration(minutes: 1),
minimumFetchInterval: const Duration(hours: 1)));
getIt<FirebaseFirestore>().settings = const Settings(
sslEnabled: false,
persistenceEnabled: false,
);
// emulator connection
getIt<FirebaseFirestore>().useFirestoreEmulator("localhost", 8080);
getIt<FirebaseAuth>().useAuthEmulator("localhost", 9099);
getIt<FirebaseStorage>().useStorageEmulator("localhost", 9199);
getIt<FirebaseFunctions>().useFunctionsEmulator("localhost", 5001);
remoteConfig.setDefaults(const {
'greeting_message': 'Hello',
});
runApp(builder());
}