Skip to content

Commit

Permalink
Add missing 'screen' analytics event for the VS code sidebar (#6844)
Browse files Browse the repository at this point in the history
  • Loading branch information
kenzieschmoll authored Nov 29, 2023
1 parent 6f0461b commit ddd3fab
Showing 1 changed file with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ import 'dart:async';
import 'package:devtools_app_shared/ui.dart';
import 'package:flutter/material.dart';

import '../../../devtools_app.dart';
import '../../shared/analytics/analytics.dart' as ga;
import '../../shared/analytics/constants.dart' as gac;
import '../../shared/common_widgets.dart';
import '../api/dart_tooling_api.dart';
import '../api/vs_code_api.dart';
import 'debug_sessions.dart';
Expand All @@ -17,17 +19,28 @@ import 'devices.dart';
///
/// Provides some basic functionality to improve discoverability of features
/// such as creation of new projects, device selection and DevTools features.
class VsCodeFlutterPanel extends StatelessWidget {
class VsCodeFlutterPanel extends StatefulWidget {
const VsCodeFlutterPanel(this.api, {super.key});

final DartToolingApi api;

@override
State<VsCodeFlutterPanel> createState() => _VsCodeFlutterPanelState();
}

class _VsCodeFlutterPanelState extends State<VsCodeFlutterPanel> {
@override
void initState() {
super.initState();
ga.screen(gac.VsCodeFlutterSidebar.id);
}

@override
Widget build(BuildContext context) {
return Column(
children: [
FutureBuilder(
future: api.vsCode,
future: widget.api.vsCode,
builder: (context, snapshot) =>
switch ((snapshot.connectionState, snapshot.data)) {
(ConnectionState.done, final vsCodeApi?) =>
Expand Down

0 comments on commit ddd3fab

Please sign in to comment.