Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add some analytics to the memory screen and clean up code. #3272

Merged
merged 2 commits into from
Aug 13, 2021

Conversation

kenzieschmoll
Copy link
Member

@kenzieschmoll kenzieschmoll commented Aug 12, 2021

Work towards #3270

@@ -207,7 +172,10 @@ class MemoryBodyState extends State<MemoryBody>
addAutoDisposeListener(controller.androidChartVisibleNotifier, () {
setState(() {
if (controller.androidChartVisibleNotifier.value) {
MemoryScreen.gaAction(key: MemoryScreen.androidChartButtonKey);
ga.select(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe add a helper to DevTools screen that
always passes in the analytics constant for the current screen?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is tricky because the calls to ga.select do not happen in the Widget subclasses of Screen. At the time that we call ga.select, we often times do not even have access to the Screen object, which is why we would have to get the id from a static method on the screen class, but we don't have access to the screenId from a screen in a static context.

Copy link
Contributor

@jacob314 jacob314 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@kenzieschmoll kenzieschmoll merged commit e553e6d into flutter:master Aug 13, 2021
@kenzieschmoll kenzieschmoll deleted the memory-analytics branch August 13, 2021 21:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants