Crashlytics: Disable in debug builds

This way no matter what, a debug build will not report to crashlytics.
As it currently did.
This commit is contained in:
Vishesh Handa
2019-10-08 23:35:39 +02:00
parent 0a858756c8
commit 73715e3417
2 changed files with 3 additions and 0 deletions

View File

@ -77,6 +77,7 @@ android {
ndk {
abiFilters 'arm64-v8a', 'armeabi-v7a', 'x86', 'x86_64'
}
ext.enableCrashlytics = false
}
}

View File

@ -11,6 +11,7 @@ void main() async {
var pref = await SharedPreferences.getInstance();
Settings.instance.load(pref);
assert(JournalApp.isInDebugMode = true);
var reportCrashes =
!JournalApp.isInDebugMode && Settings.instance.collectCrashReports;
@ -22,6 +23,7 @@ void main() async {
}
};
print("Report Crashes: $reportCrashes");
if (reportCrashes) {
await FlutterCrashlytics().initialize();
}