Skip to content

Commit 4cb6794

Browse files
committed
Merge branch 'master' of github.com:flutter/devtools
2 parents 36ca3e3 + ae379df commit 4cb6794

File tree

7 files changed

+90
-83
lines changed

7 files changed

+90
-83
lines changed

packages/devtools_app/lib/src/screens/memory/panes/chart/chart_control_pane.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,9 @@ class _ChartControlPaneState extends State<ChartControlPane>
125125
void _showLegend(BuildContext context) {
126126
final box = legendKey.currentContext!.findRenderObject() as RenderBox;
127127

128-
final colorScheme = Theme.of(context).colorScheme;
129-
final legendHeading = colorScheme.hoverTextStyle;
128+
final theme = Theme.of(context);
129+
final colorScheme = theme.colorScheme;
130+
final legendHeading = theme.hoverTextStyle;
130131

131132
// Global position.
132133
final position = box.localToGlobal(Offset.zero);

packages/devtools_app/lib/src/screens/memory/panes/chart/chart_pane.dart

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -290,8 +290,9 @@ class _MemoryChartPaneState extends State<MemoryChartPane>
290290
ChartsValues chartsValues,
291291
Offset position,
292292
) {
293-
final focusColor = Theme.of(context).focusColor;
294-
final colorScheme = Theme.of(context).colorScheme;
293+
final theme = Theme.of(context);
294+
final focusColor = theme.focusColor;
295+
final colorScheme = theme.colorScheme;
295296

296297
final box = MemoryChartPane.hoverKey.currentContext!.findRenderObject()
297298
as RenderBox;
@@ -321,7 +322,7 @@ class _MemoryChartPaneState extends State<MemoryChartPane>
321322

322323
final displayTimestamp = prettyTimestamp(chartsValues.timestamp);
323324

324-
final hoverHeading = colorScheme.hoverTitleTextStyle;
325+
final hoverHeading = theme.hoverTitleTextStyle;
325326

326327
final OverlayState overlayState = Overlay.of(context)!;
327328
_hoverOverlayEntry ??= OverlayEntry(
@@ -409,10 +410,10 @@ class _MemoryChartPaneState extends State<MemoryChartPane>
409410
bool scaleImage = false,
410411
double leftPadding = 5.0,
411412
}) {
412-
final hoverTitleEntry = Theme.of(context).colorScheme.hoverTextStyle;
413-
final hoverValueEntry = Theme.of(context).colorScheme.hoverValueTextStyle;
414-
final hoverSmallEntry =
415-
Theme.of(context).colorScheme.hoverSmallValueTextStyle;
413+
final theme = Theme.of(context);
414+
final hoverTitleEntry = theme.hoverTextStyle;
415+
final hoverValueEntry = theme.hoverValueTextStyle;
416+
final hoverSmallEntry = theme.hoverSmallValueTextStyle;
416417

417418
List<Widget> hoverPartImageLine(
418419
String name, {
@@ -560,8 +561,9 @@ class _MemoryChartPaneState extends State<MemoryChartPane>
560561
index++;
561562
}
562563

563-
final colorScheme = Theme.of(context).colorScheme;
564-
final hoverTextStyle = colorScheme.hoverTextStyle;
564+
final theme = Theme.of(context);
565+
final colorScheme = theme.colorScheme;
566+
final hoverTextStyle = theme.hoverTextStyle;
565567
final contrastForeground = colorScheme.contrastForeground;
566568
final collapsedColor = colorScheme.defaultBackgroundColor;
567569

@@ -590,8 +592,9 @@ class _MemoryChartPaneState extends State<MemoryChartPane>
590592
}
591593

592594
Widget _cardWidget(String value) {
593-
final colorScheme = Theme.of(context).colorScheme;
594-
final hoverValueEntry = colorScheme.hoverSmallValueTextStyle;
595+
final theme = Theme.of(context);
596+
final colorScheme = theme.colorScheme;
597+
final hoverValueEntry = theme.hoverSmallValueTextStyle;
595598
final expandedGradient = colorScheme.verticalGradient;
596599

597600
return Padding(

packages/devtools_app/lib/src/screens/memory/panes/chart/legend.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ class LegendRow extends StatelessWidget {
2828

2929
@override
3030
Widget build(BuildContext context) {
31-
final legendEntry = Theme.of(context).colorScheme.legendTextStyle;
31+
final theme = Theme.of(context);
32+
final legendEntry = theme.legendTextStyle;
3233

3334
List<Widget> legendPart(
3435
String name,

packages/devtools_app/lib/src/shared/theme.dart

Lines changed: 63 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -375,55 +375,6 @@ extension DevToolsColorScheme on ColorScheme {
375375

376376
Color get autoCompleteTextColor => isLight ? Colors.black : Colors.white;
377377

378-
// Title of the hover card.
379-
TextStyle get hoverTitleTextStyle => TextStyle(
380-
color: defaultForeground,
381-
fontWeight: FontWeight.normal,
382-
fontSize: scaleByFontFactor(15.0),
383-
decoration: TextDecoration.none,
384-
);
385-
386-
// Items in the hover card.
387-
TextStyle get hoverTextStyle => TextStyle(
388-
color: defaultForeground,
389-
fontWeight: FontWeight.normal,
390-
fontSize: scaleByFontFactor(11.5),
391-
decoration: TextDecoration.none,
392-
);
393-
394-
// Value of items in hover e.g., capacity, etc.
395-
TextStyle get hoverValueTextStyle => TextStyle(
396-
color: contrastForeground,
397-
fontWeight: FontWeight.normal,
398-
fontSize: scaleByFontFactor(11.5),
399-
decoration: TextDecoration.none,
400-
);
401-
402-
// Used for custom extension event values.
403-
TextStyle get hoverSmallValueTextStyle => TextStyle(
404-
color: defaultForeground,
405-
fontWeight: FontWeight.normal,
406-
fontSize: scaleByFontFactor(10.0),
407-
decoration: TextDecoration.none,
408-
);
409-
410-
// Last allocation timestamp displayed.
411-
TextStyle get italicTextStyle => TextStyle(
412-
color: defaultForeground,
413-
fontWeight: FontWeight.normal,
414-
fontSize: scaleByFontFactor(14.0),
415-
fontStyle: FontStyle.italic,
416-
decoration: TextDecoration.none,
417-
);
418-
419-
// Items in a chart's legend.
420-
TextStyle get legendTextStyle => TextStyle(
421-
color: defaultForeground,
422-
fontWeight: FontWeight.normal,
423-
fontSize: scaleByFontFactor(10.0),
424-
decoration: TextDecoration.none,
425-
);
426-
427378
Color get expandedColor => isLight ? Colors.grey[200]! : Colors.grey[800]!;
428379

429380
Color get expandedTopContentColor =>
@@ -438,20 +389,6 @@ extension DevToolsColorScheme on ColorScheme {
438389
colors: [expandedTopContentColor, expandedBottomContentColor],
439390
tileMode: TileMode.repeated,
440391
);
441-
442-
/// TextStyle for callstack.
443-
TextStyle get stackTraceCall => TextStyle(
444-
color: defaultForeground,
445-
fontWeight: FontWeight.normal,
446-
fontSize: scaleByFontFactor(12.0),
447-
);
448-
449-
/// TextStyle for source file displayed in callstack.
450-
TextStyle get stackTraceSource => TextStyle(
451-
color: defaultForeground,
452-
fontWeight: FontWeight.w100,
453-
fontSize: scaleByFontFactor(12.0),
454-
);
455392
}
456393

457394
/// Utility extension methods to the [ThemeData] class.
@@ -514,6 +451,69 @@ extension ThemeDataExtension on ThemeData {
514451
color: Colors.black,
515452
backgroundColor: searchMatchColor,
516453
);
454+
455+
// Title of the hover card.
456+
TextStyle get hoverTitleTextStyle => TextStyle(
457+
color: colorScheme.defaultForeground,
458+
fontWeight: FontWeight.normal,
459+
fontSize: scaleByFontFactor(15.0),
460+
decoration: TextDecoration.none,
461+
);
462+
463+
// Items in the hover card.
464+
TextStyle get hoverTextStyle => TextStyle(
465+
color: colorScheme.defaultForeground,
466+
fontWeight: FontWeight.normal,
467+
fontSize: scaleByFontFactor(11.5),
468+
decoration: TextDecoration.none,
469+
);
470+
471+
// Value of items in hover e.g., capacity, etc.
472+
TextStyle get hoverValueTextStyle => TextStyle(
473+
color: colorScheme.contrastForeground,
474+
fontWeight: FontWeight.normal,
475+
fontSize: scaleByFontFactor(11.5),
476+
decoration: TextDecoration.none,
477+
);
478+
479+
// Used for custom extension event values.
480+
TextStyle get hoverSmallValueTextStyle => TextStyle(
481+
color: colorScheme.defaultForeground,
482+
fontWeight: FontWeight.normal,
483+
fontSize: scaleByFontFactor(10.0),
484+
decoration: TextDecoration.none,
485+
);
486+
487+
// Last allocation timestamp displayed.
488+
TextStyle get italicTextStyle => TextStyle(
489+
color: colorScheme.defaultForeground,
490+
fontWeight: FontWeight.normal,
491+
fontSize: scaleByFontFactor(14.0),
492+
fontStyle: FontStyle.italic,
493+
decoration: TextDecoration.none,
494+
);
495+
496+
// Items in a chart's legend.
497+
TextStyle get legendTextStyle => TextStyle(
498+
color: colorScheme.defaultForeground,
499+
fontWeight: FontWeight.normal,
500+
fontSize: scaleByFontFactor(10.0),
501+
decoration: TextDecoration.none,
502+
);
503+
504+
/// TextStyle for callstack.
505+
TextStyle get stackTraceCall => TextStyle(
506+
color: colorScheme.defaultForeground,
507+
fontWeight: FontWeight.normal,
508+
fontSize: scaleByFontFactor(12.0),
509+
);
510+
511+
/// TextStyle for source file displayed in callstack.
512+
TextStyle get stackTraceSource => TextStyle(
513+
color: colorScheme.defaultForeground,
514+
fontWeight: FontWeight.w100,
515+
fontSize: scaleByFontFactor(12.0),
516+
);
517517
}
518518

519519
const extraWideSearchTextWidth = 600.0;

packages/devtools_app/lib/src/ui/hover.dart

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,10 @@ class HoverCard {
121121
}) {
122122
maxCardHeight ??= maxHoverCardHeight;
123123
final overlayState = Overlay.of(context)!;
124-
final colorScheme = Theme.of(context).colorScheme;
125-
final focusColor = Theme.of(context).focusColor;
126-
final hoverHeading = colorScheme.hoverTitleTextStyle;
124+
final theme = Theme.of(context);
125+
final colorScheme = theme.colorScheme;
126+
final focusColor = theme.focusColor;
127+
final hoverHeading = theme.hoverTitleTextStyle;
127128

128129
_overlayEntry = OverlayEntry(
129130
builder: (context) {
@@ -161,7 +162,7 @@ class HoverCard {
161162
textAlign: TextAlign.center,
162163
),
163164
),
164-
Divider(color: colorScheme.hoverTextStyle.color),
165+
Divider(color: theme.hoverTextStyle.color),
165166
],
166167
SingleChildScrollView(
167168
child: Container(

packages/devtools_app/pubspec.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ dependencies:
3333
flutter:
3434
sdk: flutter
3535
flutter_markdown: ^0.6.8
36-
flutter_riverpod: 1.0.4
36+
# TODO: https://github.com/flutter/devtools/issues/4569 - unpin this version
37+
flutter_riverpod: 2.0.0-dev.9
3738
flutter_web_plugins:
3839
sdk: flutter
3940
http: ^0.13.4

packages/devtools_app/test/network/network_request_inspector_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ void main() {
6767

6868
// Select the request in the network request list.
6969
final networkRequest = requestsNotifier.value.requests.first;
70-
controller.selectRequest(networkRequest);
70+
controller.selectedRequest.value = networkRequest;
7171
await tester.pumpAndSettle();
7272
await tester.tap(find.text('Request'));
7373
await tester.pumpAndSettle();

0 commit comments

Comments
 (0)