diff --git a/packages/devtools_app/lib/src/standalone_ui/vs_code/devtools.dart b/packages/devtools_app/lib/src/standalone_ui/vs_code/devtools.dart deleted file mode 100644 index 8e326b27ddd..00000000000 --- a/packages/devtools_app/lib/src/standalone_ui/vs_code/devtools.dart +++ /dev/null @@ -1,381 +0,0 @@ -// Copyright 2024 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'dart:async'; - -import 'package:devtools_app_shared/ui.dart'; -import 'package:devtools_app_shared/utils.dart'; -import 'package:devtools_shared/devtools_extensions.dart'; -import 'package:flutter/material.dart'; - -import '../../extensions/extension_screen.dart'; -import '../../service/editor/api_classes.dart'; -import '../../service/editor/editor_client.dart'; -import '../../shared/analytics/analytics.dart' as ga; -import '../../shared/analytics/constants.dart' as gac; -import '../../shared/common_widgets.dart'; -import '../../shared/primitives/utils.dart'; -import '../../shared/screen.dart'; -import 'devtools_extensions.dart'; - -typedef _DevToolsButtonData = ({ - String label, - IconData icon, - String screenId, - bool requiresDebugSession, - bool prefersDebugSession, -}); - -_DevToolsButtonData _buttonDataFromScreen(ScreenMetaData screen) { - final id = screen.title ?? screen.id; - return ( - label: id, - icon: screen.icon!, - screenId: screen.id, - requiresDebugSession: screen.requiresConnection, - // Only the app size screen does not care about the active debug session. - prefersDebugSession: screen != ScreenMetaData.appSize, - ); -} - -_DevToolsButtonData _buttonDataFromExtension(DevToolsExtensionConfig ext) { - return ( - label: ext.name, - icon: ext.icon, - screenId: ext.screenId, - requiresDebugSession: ext.requiresConnection, - // TODO(https://github.com/flutter/devtools/issues/7955): let extensions - // declare the type of tool they are providing: 'static-only', - // 'runtime-only', or 'static-and-runtime'. The value for - // prefersDebugSession should be true when the state is 'runtime-only' or - // 'static-and-runtime'. - prefersDebugSession: true, - ); -} - -/// A widget that displays DevTools options, including buttons to open static -/// screens, and a list of static DevTools extensions available for the IDE -/// workspace. -class DevToolsSidebarOptions extends StatelessWidget { - const DevToolsSidebarOptions({ - required this.editor, - required this.debugSessions, - super.key, - }); - - final EditorClient editor; - final Map debugSessions; - - static const _useSingleColumnThreshold = 245.0; - - @override - Widget build(BuildContext context) { - final theme = Theme.of(context); - // Use a LayoutBuilder instead of checking ScreenSize.of(context) so that - // this UI can be debugged in the mock editor environment. - return LayoutBuilder( - builder: (context, constraints) { - final singleColumn = constraints.maxWidth <= _useSingleColumnThreshold; - return Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text( - 'DevTools', - style: theme.textTheme.titleMedium, - ), - if (editor.supportsOpenDevToolsExternally) - ToolbarAction( - icon: Icons.open_in_browser_outlined, - tooltip: 'Open in browser', - onPressed: () { - ga.select( - gac.VsCodeFlutterSidebar.id, - gac.VsCodeFlutterSidebar.openDevToolsExternally.name, - ); - unawaited( - editor.openDevToolsPage(null, forceExternal: true), - ); - }, - ), - ], - ), - Table( - defaultVerticalAlignment: TableCellVerticalAlignment.middle, - columnWidths: singleColumn - ? null - : const { - 0: FlexColumnWidth(), - 1: FlexColumnWidth(), - }, - children: generateRows(singleColumn), - ), - const SizedBox(height: denseSpacing), - DevToolsExtensions( - editor: editor, - debugSessions: debugSessions, - ), - ], - ); - }, - ); - } - - List generateRows(bool singleColumn) { - final devtoolsScreens = - ScreenMetaData.values.where(includeInSidebar).toList(); - if (singleColumn) { - return devtoolsScreens - .map( - (s) => _createDevToolsScreenRow( - dataLeft: _buttonDataFromScreen(s), - dataRight: null, - editor: editor, - singleColumn: singleColumn, - hasDebugSessions: debugSessions.isNotEmpty, - onPressed: (data) => _openDevToolsScreen( - screenId: data.screenId, - requiresDebugSession: data.requiresDebugSession, - prefersDebugSession: data.prefersDebugSession, - editor: editor, - ), - ), - ) - .toList(); - } - - final rows = []; - for (int i = 0; i < devtoolsScreens.length; i += 2) { - final first = devtoolsScreens[i]; - final second = devtoolsScreens.safeGet(i + 1); - rows.add( - _createDevToolsScreenRow( - dataLeft: _buttonDataFromScreen(first), - dataRight: second != null ? _buttonDataFromScreen(second) : null, - editor: editor, - singleColumn: singleColumn, - hasDebugSessions: debugSessions.isNotEmpty, - onPressed: (data) => _openDevToolsScreen( - screenId: data.screenId, - requiresDebugSession: data.requiresDebugSession, - prefersDebugSession: data.prefersDebugSession, - editor: editor, - ), - ), - ); - } - return rows; - } - - @visibleForTesting - static bool includeInSidebar(ScreenMetaData screen) { - return switch (screen) { - ScreenMetaData.home || - ScreenMetaData.debugger || - ScreenMetaData.vmTools || - // This screen will be removed from the first party DevTools screens soon. - // If the user depends on package:provider, the provider extension should - // show up in the DevTools extensions list instead. - ScreenMetaData.provider || - ScreenMetaData.simple => - false, - _ => true, - }; - } -} - -// TODO(kenz): move this to devtools_extensions.dart in a follow up PR. -class DevToolsExtensions extends StatefulWidget { - const DevToolsExtensions({ - super.key, - required this.editor, - required this.debugSessions, - }); - - final EditorClient editor; - final Map debugSessions; - - @override - State createState() => _DevToolsExtensionsState(); -} - -class _DevToolsExtensionsState extends State - with AutoDisposeMixin { - final sidebarExtensionsController = SidebarDevToolsExtensionsController(); - - @override - void initState() { - super.initState(); - unawaited(sidebarExtensionsController.init(widget.debugSessions)); - addAutoDisposeListener(sidebarExtensionsController.uniqueExtensions); - } - - @override - void didUpdateWidget(DevToolsExtensions oldWidget) { - super.didUpdateWidget(oldWidget); - unawaited( - sidebarExtensionsController.updateForDebugSessions(widget.debugSessions), - ); - } - - @override - void dispose() { - sidebarExtensionsController.dispose(); - super.dispose(); - } - - @override - Widget build(BuildContext context) { - final extensions = sidebarExtensionsController.uniqueExtensions.value; - if (extensions.isEmpty) return const SizedBox(); - return Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - 'DevTools Extensions', - style: Theme.of(context).textTheme.titleMedium, - ), - Table( - defaultVerticalAlignment: TableCellVerticalAlignment.middle, - children: generateRows(extensions), - ), - ], - ); - } - - List generateRows(List extensions) { - final rows = []; - for (int i = 0; i < extensions.length; i++) { - final ext = extensions[i]; - final data = _buttonDataFromExtension(ext); - rows.add( - _createDevToolsScreenRow( - dataLeft: data, - dataRight: null, - // Extensions will always be laid out along a single column - // because we do not have control over how long the names - // will be and we want to avoid ugly text wrapping. - singleColumn: true, - editor: widget.editor, - hasDebugSessions: widget.debugSessions.isNotEmpty, - onPressed: (data) { - ga.select( - gac.VsCodeFlutterSidebar.id, - gac.VsCodeFlutterSidebar.openDevToolsScreen( - gac.DevToolsExtensionEvents.extensionScreenName(ext), - ), - ); - unawaited( - widget.editor.openDevToolsPage(null, page: ext.screenId), - ); - }, - ), - ); - } - return rows; - } -} - -TableRow _createDevToolsScreenRow({ - required _DevToolsButtonData dataLeft, - required _DevToolsButtonData? dataRight, - required bool singleColumn, - required bool hasDebugSessions, - required EditorClient editor, - required void Function(_DevToolsButtonData data) onPressed, -}) { - assert( - !singleColumn || dataRight == null, - 'dataRight must be null is singleColumn is true', - ); - final cellRight = dataRight != null - ? _DevToolsScreenButton( - data: dataRight, - editor: editor, - hasDebugSessions: hasDebugSessions, - onPressed: onPressed, - ) - : const SizedBox(); - return TableRow( - children: [ - _DevToolsScreenButton( - data: dataLeft, - editor: editor, - hasDebugSessions: hasDebugSessions, - onPressed: onPressed, - ), - if (!singleColumn) cellRight, - ], - ); -} - -class _DevToolsScreenButton extends StatelessWidget { - const _DevToolsScreenButton({ - required this.data, - required this.editor, - required this.hasDebugSessions, - required this.onPressed, - }); - - final _DevToolsButtonData data; - final EditorClient editor; - final bool hasDebugSessions; - final void Function(_DevToolsButtonData data) onPressed; - - @override - Widget build(BuildContext context) { - final theme = Theme.of(context); - // TODO(kenz): consider also disabling tools based on the available debug - // sessions. For example, if the only debug session is a Web app, we know - // some tools are not available. - final disableButton = data.requiresDebugSession && !hasDebugSessions; - return SizedBox( - width: double.infinity, - child: maybeWrapWithTooltip( - tooltip: - disableButton ? 'This tool requires an active debug session' : null, - child: TextButton.icon( - style: TextButton.styleFrom( - alignment: Alignment.centerLeft, - shape: const ContinuousRectangleBorder(), - textStyle: theme.regularTextStyle, - ), - icon: Icon( - data.icon, - size: actionsIconSize, - color: theme.colorScheme.onSurface, - ), - label: Text( - data.label, - style: - disableButton ? theme.subtleTextStyle : theme.regularTextStyle, - ), - onPressed: disableButton ? null : () => onPressed(data), - ), - ), - ); - } -} - -void _openDevToolsScreen({ - required String screenId, - required bool requiresDebugSession, - required bool prefersDebugSession, - required EditorClient editor, -}) { - ga.select( - gac.VsCodeFlutterSidebar.id, - gac.VsCodeFlutterSidebar.openDevToolsScreen(screenId), - ); - unawaited( - editor.openDevToolsPage( - null, - page: screenId, - requiresDebugSession: requiresDebugSession, - prefersDebugSession: prefersDebugSession, - ), - ); -} diff --git a/packages/devtools_app/lib/src/standalone_ui/vs_code/devtools/devtools_view.dart b/packages/devtools_app/lib/src/standalone_ui/vs_code/devtools/devtools_view.dart new file mode 100644 index 00000000000..bb0dbeb0c1d --- /dev/null +++ b/packages/devtools_app/lib/src/standalone_ui/vs_code/devtools/devtools_view.dart @@ -0,0 +1,189 @@ +// Copyright 2024 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'dart:async'; + +import 'package:devtools_app_shared/ui.dart'; +import 'package:flutter/material.dart'; + +import '../../../service/editor/api_classes.dart'; +import '../../../service/editor/editor_client.dart'; +import '../../../shared/analytics/analytics.dart' as ga; +import '../../../shared/analytics/constants.dart' as gac; +import '../../../shared/common_widgets.dart'; +import '../../../shared/primitives/utils.dart'; +import '../../../shared/screen.dart'; +import 'extensions_view.dart'; +import 'shared.dart'; + +/// A widget that displays DevTools options with buttons to open each DevTools +/// screen or extension. +class DevToolsSidebarOptions extends StatelessWidget { + const DevToolsSidebarOptions({ + required this.editor, + required this.debugSessions, + super.key, + }); + + final EditorClient editor; + final Map debugSessions; + + static const _useSingleColumnThreshold = 245.0; + + @override + Widget build(BuildContext context) { + // Use a LayoutBuilder instead of checking ScreenSize.of(context) so that + // this UI can be debugged in the mock editor environment. + return LayoutBuilder( + builder: (context, constraints) { + final singleColumn = constraints.maxWidth <= _useSingleColumnThreshold; + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SidebarDevToolsScreens( + editor: editor, + debugSessions: debugSessions, + singleColumn: singleColumn, + ), + const SizedBox(height: denseSpacing), + SidebarDevToolsExtensions( + editor: editor, + debugSessions: debugSessions, + ), + ], + ); + }, + ); + } +} + +class SidebarDevToolsScreens extends StatelessWidget { + const SidebarDevToolsScreens({ + super.key, + required this.editor, + required this.debugSessions, + required this.singleColumn, + }); + + final EditorClient editor; + final Map debugSessions; + final bool singleColumn; + + @override + Widget build(BuildContext context) { + final theme = Theme.of(context); + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + 'DevTools', + style: theme.textTheme.titleMedium, + ), + if (editor.supportsOpenDevToolsExternally) + ToolbarAction( + icon: Icons.open_in_browser_outlined, + tooltip: 'Open in browser', + onPressed: () { + ga.select( + gac.VsCodeFlutterSidebar.id, + gac.VsCodeFlutterSidebar.openDevToolsExternally.name, + ); + unawaited( + editor.openDevToolsPage(null, forceExternal: true), + ); + }, + ), + ], + ), + Table( + defaultVerticalAlignment: TableCellVerticalAlignment.middle, + columnWidths: singleColumn + ? null + : const { + 0: FlexColumnWidth(), + 1: FlexColumnWidth(), + }, + children: generateRows(singleColumn), + ), + ], + ); + } + + List generateRows(bool singleColumn) { + final devtoolsScreens = + ScreenMetaData.values.where(includeInSidebar).toList(); + if (singleColumn) { + return devtoolsScreens + .map( + (s) => createDevToolsScreenRow( + dataLeft: _buttonDataFromScreen(s), + dataRight: null, + editor: editor, + singleColumn: singleColumn, + hasDebugSessions: debugSessions.isNotEmpty, + onPressed: (data) => openDevToolsScreen( + screenId: data.screenId, + requiresDebugSession: data.requiresDebugSession, + prefersDebugSession: data.prefersDebugSession, + editor: editor, + ), + ), + ) + .toList(); + } + + final rows = []; + for (int i = 0; i < devtoolsScreens.length; i += 2) { + final first = devtoolsScreens[i]; + final second = devtoolsScreens.safeGet(i + 1); + rows.add( + createDevToolsScreenRow( + dataLeft: _buttonDataFromScreen(first), + dataRight: second != null ? _buttonDataFromScreen(second) : null, + editor: editor, + singleColumn: singleColumn, + hasDebugSessions: debugSessions.isNotEmpty, + onPressed: (data) => openDevToolsScreen( + screenId: data.screenId, + requiresDebugSession: data.requiresDebugSession, + prefersDebugSession: data.prefersDebugSession, + editor: editor, + ), + ), + ); + } + return rows; + } + + DevToolsButtonData _buttonDataFromScreen(ScreenMetaData screen) { + final id = screen.title ?? screen.id; + return ( + label: id, + icon: screen.icon!, + screenId: screen.id, + requiresDebugSession: screen.requiresConnection, + // Only the app size screen does not care about the active debug session. + prefersDebugSession: screen != ScreenMetaData.appSize, + ); + } + + @visibleForTesting + static bool includeInSidebar(ScreenMetaData screen) { + return switch (screen) { + ScreenMetaData.home || + ScreenMetaData.debugger || + ScreenMetaData.vmTools || + // This screen will be removed from the first party DevTools screens soon. + // If the user depends on package:provider, the provider extension should + // show up in the DevTools extensions list instead. + ScreenMetaData.provider || + ScreenMetaData.simple => + false, + _ => true, + }; + } +} diff --git a/packages/devtools_app/lib/src/standalone_ui/vs_code/devtools/extensions_view.dart b/packages/devtools_app/lib/src/standalone_ui/vs_code/devtools/extensions_view.dart new file mode 100644 index 00000000000..f4d2a378072 --- /dev/null +++ b/packages/devtools_app/lib/src/standalone_ui/vs_code/devtools/extensions_view.dart @@ -0,0 +1,124 @@ +// Copyright 2024 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'dart:async'; + +import 'package:devtools_app_shared/utils.dart'; +import 'package:devtools_shared/devtools_extensions.dart'; +import 'package:flutter/material.dart'; + +import '../../../extensions/extension_screen.dart'; +import '../../../service/editor/api_classes.dart'; +import '../../../service/editor/editor_client.dart'; +import '../../../shared/analytics/analytics.dart' as ga; +import '../../../shared/analytics/constants.dart' as gac; +import 'shared.dart'; +import 'sidebar_extensions_controller.dart'; + +DevToolsButtonData _buttonDataFromExtension(DevToolsExtensionConfig ext) { + return ( + label: ext.name, + icon: ext.icon, + screenId: ext.screenId, + requiresDebugSession: ext.requiresConnection, + // TODO(https://github.com/flutter/devtools/issues/7955): let extensions + // declare the type of tool they are providing: 'static-only', + // 'runtime-only', or 'static-and-runtime'. The value for + // prefersDebugSession should be true when the state is 'runtime-only' or + // 'static-and-runtime'. + prefersDebugSession: true, + ); +} + +class SidebarDevToolsExtensions extends StatefulWidget { + const SidebarDevToolsExtensions({ + super.key, + required this.editor, + required this.debugSessions, + }); + + final EditorClient editor; + final Map debugSessions; + + @override + State createState() => + _SidebarDevToolsExtensionsState(); +} + +class _SidebarDevToolsExtensionsState extends State + with AutoDisposeMixin { + final sidebarExtensionsController = SidebarDevToolsExtensionsController(); + + @override + void initState() { + super.initState(); + unawaited(sidebarExtensionsController.init(widget.debugSessions)); + addAutoDisposeListener(sidebarExtensionsController.uniqueExtensions); + } + + @override + void didUpdateWidget(SidebarDevToolsExtensions oldWidget) { + super.didUpdateWidget(oldWidget); + unawaited( + sidebarExtensionsController.updateForDebugSessions(widget.debugSessions), + ); + } + + @override + void dispose() { + sidebarExtensionsController.dispose(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + final extensions = sidebarExtensionsController.uniqueExtensions.value; + if (extensions.isEmpty) return const SizedBox(); + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + 'DevTools Extensions', + style: Theme.of(context).textTheme.titleMedium, + ), + Table( + defaultVerticalAlignment: TableCellVerticalAlignment.middle, + children: generateRows(extensions), + ), + ], + ); + } + + List generateRows(List extensions) { + final rows = []; + for (int i = 0; i < extensions.length; i++) { + final ext = extensions[i]; + final data = _buttonDataFromExtension(ext); + rows.add( + createDevToolsScreenRow( + dataLeft: data, + dataRight: null, + // Extensions will always be laid out along a single column + // because we do not have control over how long the names + // will be and we want to avoid ugly text wrapping. + singleColumn: true, + editor: widget.editor, + hasDebugSessions: widget.debugSessions.isNotEmpty, + onPressed: (data) { + ga.select( + gac.VsCodeFlutterSidebar.id, + gac.VsCodeFlutterSidebar.openDevToolsScreen( + gac.DevToolsExtensionEvents.extensionScreenName(ext), + ), + ); + unawaited( + widget.editor.openDevToolsPage(null, page: ext.screenId), + ); + }, + ), + ); + } + return rows; + } +} diff --git a/packages/devtools_app/lib/src/standalone_ui/vs_code/devtools/shared.dart b/packages/devtools_app/lib/src/standalone_ui/vs_code/devtools/shared.dart new file mode 100644 index 00000000000..fb8a68e4efa --- /dev/null +++ b/packages/devtools_app/lib/src/standalone_ui/vs_code/devtools/shared.dart @@ -0,0 +1,121 @@ +// Copyright 2024 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'dart:async'; + +import 'package:devtools_app_shared/ui.dart'; +import 'package:flutter/material.dart'; + +import '../../../service/editor/editor_client.dart'; +import '../../../shared/analytics/analytics.dart' as ga; +import '../../../shared/analytics/constants.dart' as gac; + +typedef DevToolsButtonData = ({ + String label, + IconData icon, + String screenId, + bool requiresDebugSession, + bool prefersDebugSession, +}); + +TableRow createDevToolsScreenRow({ + required DevToolsButtonData dataLeft, + required DevToolsButtonData? dataRight, + required bool singleColumn, + required bool hasDebugSessions, + required EditorClient editor, + required void Function(DevToolsButtonData data) onPressed, +}) { + assert( + !singleColumn || dataRight == null, + 'dataRight must be null is singleColumn is true', + ); + final cellRight = dataRight != null + ? _DevToolsScreenButton( + data: dataRight, + editor: editor, + hasDebugSessions: hasDebugSessions, + onPressed: onPressed, + ) + : const SizedBox(); + return TableRow( + children: [ + _DevToolsScreenButton( + data: dataLeft, + editor: editor, + hasDebugSessions: hasDebugSessions, + onPressed: onPressed, + ), + if (!singleColumn) cellRight, + ], + ); +} + +class _DevToolsScreenButton extends StatelessWidget { + const _DevToolsScreenButton({ + required this.data, + required this.editor, + required this.hasDebugSessions, + required this.onPressed, + }); + + final DevToolsButtonData data; + final EditorClient editor; + final bool hasDebugSessions; + final void Function(DevToolsButtonData data) onPressed; + + @override + Widget build(BuildContext context) { + final theme = Theme.of(context); + // TODO(kenz): consider also disabling tools based on the available debug + // sessions. For example, if the only debug session is a Web app, we know + // some tools are not available. + final disableButton = data.requiresDebugSession && !hasDebugSessions; + return SizedBox( + width: double.infinity, + child: maybeWrapWithTooltip( + tooltip: + disableButton ? 'This tool requires an active debug session' : null, + child: TextButton.icon( + style: TextButton.styleFrom( + alignment: Alignment.centerLeft, + shape: const ContinuousRectangleBorder(), + textStyle: theme.regularTextStyle, + ), + icon: Icon( + data.icon, + size: actionsIconSize, + color: theme.colorScheme.onSurface, + ), + label: Text( + data.label, + style: + disableButton ? theme.subtleTextStyle : theme.regularTextStyle, + ), + onPressed: disableButton ? null : () => onPressed(data), + ), + ), + ); + } +} + +void openDevToolsScreen({ + required String screenId, + required bool requiresDebugSession, + required bool prefersDebugSession, + required EditorClient editor, +}) { + ga.select( + gac.VsCodeFlutterSidebar.id, + gac.VsCodeFlutterSidebar.openDevToolsScreen(screenId), + ); + unawaited( + editor.openDevToolsPage( + null, + page: screenId, + requiresDebugSession: requiresDebugSession, + prefersDebugSession: prefersDebugSession, + ), + ); +} diff --git a/packages/devtools_app/lib/src/standalone_ui/vs_code/devtools_extensions.dart b/packages/devtools_app/lib/src/standalone_ui/vs_code/devtools/sidebar_extensions_controller.dart similarity index 97% rename from packages/devtools_app/lib/src/standalone_ui/vs_code/devtools_extensions.dart rename to packages/devtools_app/lib/src/standalone_ui/vs_code/devtools/sidebar_extensions_controller.dart index 78abc9e609e..b9b6795025c 100644 --- a/packages/devtools_app/lib/src/standalone_ui/vs_code/devtools_extensions.dart +++ b/packages/devtools_app/lib/src/standalone_ui/vs_code/devtools/sidebar_extensions_controller.dart @@ -9,10 +9,10 @@ import 'package:devtools_shared/devtools_extensions.dart'; import 'package:flutter/foundation.dart'; import 'package:logging/logging.dart'; -import '../../extensions/extension_service.dart'; -import '../../extensions/extension_service_helpers.dart'; -import '../../service/editor/api_classes.dart'; -import '../../shared/globals.dart'; +import '../../../extensions/extension_service.dart'; +import '../../../extensions/extension_service_helpers.dart'; +import '../../../service/editor/api_classes.dart'; +import '../../../shared/globals.dart'; final _devToolsExtensionsLog = Logger('Flutter Sidebar - DevTools Extensions'); diff --git a/packages/devtools_app/lib/src/standalone_ui/vs_code/flutter_panel.dart b/packages/devtools_app/lib/src/standalone_ui/vs_code/flutter_panel.dart index c45cdfe07b9..8f9406e3904 100644 --- a/packages/devtools_app/lib/src/standalone_ui/vs_code/flutter_panel.dart +++ b/packages/devtools_app/lib/src/standalone_ui/vs_code/flutter_panel.dart @@ -15,7 +15,7 @@ import '../api/dart_tooling_api.dart'; import '../api/impl/dart_tooling_api.dart'; import 'debug_sessions.dart'; import 'devices.dart'; -import 'devtools.dart'; +import 'devtools/devtools_view.dart'; /// A general Flutter sidebar panel for embedding inside IDEs. /// diff --git a/packages/devtools_app/test/standalone_ui/vs_code/devtools_test.dart b/packages/devtools_app/test/standalone_ui/vs_code/devtools_test.dart index b9180890bbc..74b7511b1a0 100644 --- a/packages/devtools_app/test/standalone_ui/vs_code/devtools_test.dart +++ b/packages/devtools_app/test/standalone_ui/vs_code/devtools_test.dart @@ -5,7 +5,7 @@ import 'package:devtools_app/devtools_app.dart'; import 'package:devtools_app/src/service/editor/api_classes.dart'; import 'package:devtools_app/src/shared/development_helpers.dart'; -import 'package:devtools_app/src/standalone_ui/vs_code/devtools.dart'; +import 'package:devtools_app/src/standalone_ui/vs_code/devtools/devtools_view.dart'; import 'package:devtools_app_shared/service.dart'; import 'package:devtools_app_shared/ui.dart'; import 'package:devtools_app_shared/utils.dart'; @@ -96,7 +96,7 @@ void main() { expect(find.text('DevTools'), findsOneWidget); for (final screen in ScreenMetaData.values) { - final include = DevToolsSidebarOptions.includeInSidebar(screen); + final include = SidebarDevToolsScreens.includeInSidebar(screen); // Do not check the 'simple' or 'home' screens because they do not // have a title we can verify against. if (screen != ScreenMetaData.simple &&