File tree Expand file tree Collapse file tree
packages/devtools_app/lib Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22// Use of this source code is governed by a BSD-style license that can be
33// found in the LICENSE file or at https://developers.google.com/open-source/licenses/bsd.
44
5+ import 'dart:async' ;
6+
57import 'package:devtools_app_shared/utils.dart' ;
68import 'package:flutter/material.dart' ;
79import 'package:flutter_web_plugins/url_strategy.dart' ;
810
911import 'src/app.dart' ;
1012import 'src/framework/framework_core.dart' ;
1113import 'src/screens/debugger/syntax_highlighter.dart' ;
14+ import 'src/shared/analytics/analytics.dart' as ga;
1215import 'src/shared/analytics/analytics_controller.dart' ;
1316import 'src/shared/config_specific/logger/logger_helpers.dart' ;
1417import 'src/shared/feature_flags.dart' ;
@@ -73,6 +76,11 @@ Future<void> initializeDevTools({
7376 enableExperiments: shouldEnableExperiments,
7477 );
7578
79+ // Initialize analytics metrics before initializing the framework so that any
80+ // analytics events include the expected metadata.
81+ // TODO(kenz): consider making the dimensions that need initialization `late`
82+ // so that they can be initialized on first access rather than manually.
83+ unawaited (ga.setupDimensions ());
7684 await FrameworkCore .init ();
7785}
7886
Original file line number Diff line number Diff line change @@ -45,7 +45,6 @@ import 'screens/provider/provider_screen.dart';
4545import 'screens/vm_developer/vm_developer_tools_controller.dart' ;
4646import 'screens/vm_developer/vm_developer_tools_screen.dart' ;
4747import 'service/service_extension_widgets.dart' ;
48- import 'shared/analytics/analytics.dart' as ga;
4948import 'shared/analytics/analytics_controller.dart' ;
5049import 'shared/feature_flags.dart' ;
5150import 'shared/framework/framework_controller.dart' ;
@@ -168,8 +167,6 @@ class DevToolsAppState extends State<DevToolsApp> with AutoDisposeMixin {
168167 // unawaited(BrowserContextMenu.disableContextMenu());
169168 // }
170169
171- unawaited (ga.setupDimensions ());
172-
173170 void clearRoutesAndSetState () {
174171 setState (() {
175172 _clearCachedRoutes ();
You can’t perform that action at this time.
0 commit comments