refactor: disable firebase for now.

This commit is contained in:
Aunali321 2022-10-17 19:52:47 +05:30
parent 273aa42b17
commit 39401a78ec
2 changed files with 13 additions and 16 deletions

View file

@ -17,7 +17,7 @@ import 'firebase_options.dart';
import 'package:flutter_dotenv/flutter_dotenv.dart';
Future main() async {
await dotenv.load(fileName: ".env");
await dotenv.load();
await ThemeManager.initialise();
await setupLocator();
WidgetsFlutterBinding.ensureInitialized();
@ -25,19 +25,15 @@ Future main() async {
String apiUrl = locator<ManagerAPI>().getApiUrl();
await locator<RevancedAPI>().initialize(apiUrl);
bool isSentryEnabled = locator<ManagerAPI>().isSentryEnabled();
bool isCrashlyticsEnabled = locator<ManagerAPI>().isCrashlyticsEnabled();
// bool isCrashlyticsEnabled = locator<ManagerAPI>().isCrashlyticsEnabled();
// Remove this section if you are building from source and don't have firebase config
if (isCrashlyticsEnabled) {
await Firebase.initializeApp(
options: DefaultFirebaseOptions.currentPlatform,
);
Firebase.app().setAutomaticDataCollectionEnabled(true);
} else {
await Firebase.initializeApp(
options: DefaultFirebaseOptions.currentPlatform,
);
Firebase.app().setAutomaticDataCollectionEnabled(false);
}
// if (isCrashlyticsEnabled) {
// await Firebase.initializeApp();
// Firebase.app().setAutomaticDataCollectionEnabled(true);
// } else {
// await Firebase.initializeApp();
// Firebase.app().setAutomaticDataCollectionEnabled(false);
// }
locator<GithubAPI>().initialize();
await locator<PatcherAPI>().initialize();
tz.initializeTimeZones();
@ -62,9 +58,9 @@ Future main() async {
} as BeforeSendCallback?;
},
appRunner: () {
if (isCrashlyticsEnabled) {
FlutterError.onError = FirebaseCrashlytics.instance.recordFlutterError;
}
// if (isCrashlyticsEnabled) {
// FlutterError.onError = FirebaseCrashlytics.instance.recordFlutterError;
// }
runApp(const MyApp());
},
);

View file

@ -92,3 +92,4 @@ flutter:
uses-material-design: true
assets:
- assets/i18n/
- .env