mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-29 10:17:16 +08:00
More comprehensive setup analytics
This commit is contained in:
@ -477,25 +477,38 @@ class GitHostSetupScreenState extends State<GitHostSetupScreen> {
|
|||||||
await repo.commit(message: "Add gitignore file");
|
await repo.commit(message: "Add gitignore file");
|
||||||
}
|
}
|
||||||
|
|
||||||
String hostType = "Unknown";
|
|
||||||
if (_gitCloneUrl.contains("github.com")) {
|
|
||||||
hostType = "GitHub";
|
|
||||||
} else if (_gitCloneUrl.contains("gitlab.org")) {
|
|
||||||
hostType = "GitLab.org";
|
|
||||||
} else if (_gitCloneUrl.contains("gitlab")) {
|
|
||||||
hostType = "GitLab";
|
|
||||||
}
|
|
||||||
|
|
||||||
getAnalytics().logEvent(
|
getAnalytics().logEvent(
|
||||||
name: "onboarding_complete",
|
name: "onboarding_complete",
|
||||||
parameters: <String, dynamic>{
|
parameters: _buildOnboardingAnalytics(),
|
||||||
"host_type": hostType,
|
|
||||||
},
|
|
||||||
);
|
);
|
||||||
Navigator.pop(context);
|
Navigator.pop(context);
|
||||||
widget.onCompletedFunction();
|
widget.onCompletedFunction();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> _buildOnboardingAnalytics() {
|
||||||
|
var map = <String, dynamic>{};
|
||||||
|
|
||||||
|
if (_gitCloneUrl.contains("github.com")) {
|
||||||
|
map["host_type"] = "GitHub";
|
||||||
|
} else if (_gitCloneUrl.contains("gitlab.org")) {
|
||||||
|
map["host_type"] = "GitLab.org";
|
||||||
|
} else if (_gitCloneUrl.contains("gitlab")) {
|
||||||
|
map["host_type"] = "GitLab";
|
||||||
|
}
|
||||||
|
|
||||||
|
var ch0 = _pageChoice[0] as PageChoice0;
|
||||||
|
map["provider_choice"] = ch0.toString().replaceFirst("PageChoice0.", "");
|
||||||
|
|
||||||
|
var ch1 = _pageChoice[1] as PageChoice1;
|
||||||
|
map["setup_manner"] = ch1.toString().replaceFirst("PageChoice1.", "");
|
||||||
|
|
||||||
|
map["key_generation"] = _keyGenerationChoice
|
||||||
|
.toString()
|
||||||
|
.replaceFirst("KeyGenerationChoice.", "");
|
||||||
|
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
Future _removeExistingClone(String baseDirPath) async {
|
Future _removeExistingClone(String baseDirPath) async {
|
||||||
var baseDir = Directory(p.join(baseDirPath, "journal"));
|
var baseDir = Directory(p.join(baseDirPath, "journal"));
|
||||||
var dotGitDir = Directory(p.join(baseDir.path, ".git"));
|
var dotGitDir = Directory(p.join(baseDir.path, ".git"));
|
||||||
|
Reference in New Issue
Block a user