mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-28 09:47:35 +08:00
OnBoarding: Add all relevant analytics
This commit is contained in:
@ -16,13 +16,9 @@ class JournalApp extends StatelessWidget {
|
|||||||
final stateContainer = StateContainer.of(context);
|
final stateContainer = StateContainer.of(context);
|
||||||
|
|
||||||
var onBoardingDone = stateContainer.appState.onBoardingCompleted;
|
var onBoardingDone = stateContainer.appState.onBoardingCompleted;
|
||||||
var markOnBoardingCompleted = () {
|
|
||||||
stateContainer.completeOnBoarding();
|
|
||||||
analytics.logEvent(name: "onboarding_complete");
|
|
||||||
};
|
|
||||||
var home = onBoardingDone
|
var home = onBoardingDone
|
||||||
? new HomeScreen()
|
? new HomeScreen()
|
||||||
: new OnBoardingScreen(markOnBoardingCompleted);
|
: new OnBoardingScreen(stateContainer.completeOnBoarding);
|
||||||
|
|
||||||
return new MaterialApp(
|
return new MaterialApp(
|
||||||
title: 'GitJournal',
|
title: 'GitJournal',
|
||||||
|
@ -55,6 +55,11 @@ class OnBoardingScreenState extends State<OnBoardingScreen> {
|
|||||||
pref.setString("sshCloneUrl", sshUrl);
|
pref.setString("sshCloneUrl", sshUrl);
|
||||||
this._generateSshKey();
|
this._generateSshKey();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
getAnalytics().logEvent(
|
||||||
|
name: "onboarding_git_url_enterred",
|
||||||
|
parameters: <String, dynamic>{},
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (pos == 1) {
|
if (pos == 1) {
|
||||||
@ -65,6 +70,11 @@ class OnBoardingScreenState extends State<OnBoardingScreen> {
|
|||||||
duration: Duration(milliseconds: 200),
|
duration: Duration(milliseconds: 200),
|
||||||
curve: Curves.easeIn,
|
curve: Curves.easeIn,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
getAnalytics().logEvent(
|
||||||
|
name: "onboarding_public_key_copied",
|
||||||
|
parameters: <String, dynamic>{},
|
||||||
|
);
|
||||||
},
|
},
|
||||||
publicKey: publicKey,
|
publicKey: publicKey,
|
||||||
);
|
);
|
||||||
@ -72,7 +82,13 @@ class OnBoardingScreenState extends State<OnBoardingScreen> {
|
|||||||
|
|
||||||
if (pos == 2) {
|
if (pos == 2) {
|
||||||
return OnBoardingGitClone(
|
return OnBoardingGitClone(
|
||||||
doneFunction: this.widget.onBoardingCompletedFunction,
|
doneFunction: () {
|
||||||
|
getAnalytics().logEvent(
|
||||||
|
name: "onboarding_complete",
|
||||||
|
parameters: <String, dynamic>{},
|
||||||
|
);
|
||||||
|
this.widget.onBoardingCompletedFunction();
|
||||||
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -308,6 +324,12 @@ class OnBoardingGitCloneState extends State<OnBoardingGitClone> {
|
|||||||
String error = await gitClone(sshCloneUrl, "journal");
|
String error = await gitClone(sshCloneUrl, "journal");
|
||||||
if (error != null && error.isNotEmpty) {
|
if (error != null && error.isNotEmpty) {
|
||||||
setState(() {
|
setState(() {
|
||||||
|
getAnalytics().logEvent(
|
||||||
|
name: "onboarding_gitClone_error",
|
||||||
|
parameters: <String, dynamic>{
|
||||||
|
'error': error,
|
||||||
|
},
|
||||||
|
);
|
||||||
errorMessage = error;
|
errorMessage = error;
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user