Disable analytics in debug mode

Sadly we can only do this in Android, there doesn't seem to be a way to
disable it on iOS.

https://github.com/flutter/flutter/issues/21063
This commit is contained in:
Vishesh Handa
2019-01-18 12:30:01 +01:00
parent d6d68a5a0f
commit b322e4806d
2 changed files with 13 additions and 1 deletions

View File

@ -32,6 +32,12 @@ Future runJournalApp() async {
var pref = await SharedPreferences.getInstance();
var onBoardingCompleted = pref.getBool("onBoardingCompleted") ?? false;
if (JournalApp.isInDebugMode) {
if (JournalApp.analytics.android != null) {
JournalApp.analytics.android.setAnalyticsCollectionEnabled(false);
}
}
runApp(new StateContainer(
onBoardingCompleted: onBoardingCompleted,
child: JournalApp(),