@@ -6,47 +6,37 @@ import 'package:devtools_app_shared/ui.dart';
66import 'package:flutter/foundation.dart' ;
77import 'package:flutter/material.dart' ;
88
9+ import '../../../framework/scaffold/bottom_pane.dart' ;
910import '../../globals.dart' ;
1011import '../../ui/common_widgets.dart' ;
12+ import '../../ui/tab.dart' ;
1113import '../console.dart' ;
1214import '../console_service.dart' ;
1315import 'evaluate.dart' ;
1416import 'help_dialog.dart' ;
1517
1618// TODO(devoncarew): Show some small UI indicator when we receive stdout/stderr.
1719
18- class ConsolePaneHeader extends AreaPaneHeader {
19- ConsolePaneHeader ({super .key})
20- : super (
21- title: const Text ('Console' ),
22- roundedTopBorder: true ,
23- actions: [
24- const ConsoleHelpLink (),
25- const SizedBox (width: densePadding),
26- CopyToClipboardControl (
27- dataProvider: () =>
28- serviceConnection.consoleService.stdio.value.join ('\n ' ),
29- buttonKey: ConsolePane .copyToClipboardButtonKey,
30- ),
31- const SizedBox (width: densePadding),
32- DeleteControl (
33- buttonKey: ConsolePane .clearStdioButtonKey,
34- tooltip: 'Clear console output' ,
35- onPressed: () => serviceConnection.consoleService.clearStdio (),
36- ),
37- ],
38- );
39- }
40-
4120/// Display the stdout and stderr output from the process under debug.
42- class ConsolePane extends StatelessWidget {
21+ class ConsolePane extends StatelessWidget implements TabbedPane {
4322 const ConsolePane ({super .key});
4423
4524 static const copyToClipboardButtonKey = Key (
4625 'console_copy_to_clipboard_button' ,
4726 );
4827 static const clearStdioButtonKey = Key ('console_clear_stdio_button' );
4928
29+ static const _tabName = 'Console' ;
30+
31+ static const _gaPrefix = 'consolePane' ;
32+
33+ @override
34+ DevToolsTab get tab => DevToolsTab .create (
35+ tabName: _tabName,
36+ gaPrefix: _gaPrefix,
37+ trailing: const _ConsoleActions (),
38+ );
39+
5040 ValueListenable <List <ConsoleLine >> get stdio =>
5141 serviceConnection.consoleService.stdio;
5242
@@ -61,10 +51,30 @@ class ConsolePane extends StatelessWidget {
6151 footer = const ExpressionEvalField ();
6252 }
6353
64- return Column (
65- children: [
66- Expanded (
67- child: Console (lines: stdio, footer: footer),
54+ return Console (lines: stdio, footer: footer);
55+ }
56+ }
57+
58+ class _ConsoleActions extends StatelessWidget {
59+ const _ConsoleActions ();
60+
61+ @override
62+ Widget build (BuildContext context) {
63+ return Row (
64+ mainAxisSize: MainAxisSize .min,
65+ children: < Widget > [
66+ const ConsoleHelpLink (),
67+ const SizedBox (width: densePadding),
68+ CopyToClipboardControl (
69+ dataProvider: () =>
70+ serviceConnection.consoleService.stdio.value.join ('\n ' ),
71+ buttonKey: ConsolePane .copyToClipboardButtonKey,
72+ ),
73+ const SizedBox (width: densePadding),
74+ DeleteControl (
75+ buttonKey: ConsolePane .clearStdioButtonKey,
76+ tooltip: 'Clear console output' ,
77+ onPressed: () => serviceConnection.consoleService.clearStdio (),
6878 ),
6979 ],
7080 );
0 commit comments