diff --git a/flutter-candidate.txt b/flutter-candidate.txt index 9a66865d80c..4eec4d6c3ae 100644 --- a/flutter-candidate.txt +++ b/flutter-candidate.txt @@ -1 +1 @@ -3e4f1cdf494e09304587f648456f2560d3628fe9 +aea84342eb861832bbf8578de432c4da5a074136 diff --git a/packages/devtools_app/lib/src/screens/debugger/debugger_screen.dart b/packages/devtools_app/lib/src/screens/debugger/debugger_screen.dart index c192606e467..0e45428602f 100644 --- a/packages/devtools_app/lib/src/screens/debugger/debugger_screen.dart +++ b/packages/devtools_app/lib/src/screens/debugger/debugger_screen.dart @@ -565,7 +565,8 @@ class _FloatingDebuggerControlsState extends State @override Widget build(BuildContext context) { - final colorScheme = Theme.of(context).colorScheme; + final theme = Theme.of(context); + final colorScheme = theme.colorScheme; return AnimatedOpacity( opacity: _isPaused ? 1.0 : 0.0, duration: longDuration, @@ -580,10 +581,7 @@ class _FloatingDebuggerControlsState extends State color: colorScheme.warningContainer, height: controlHeight, child: OutlinedRowGroup( - // Default focus color for the light theme - since the background - // color of the controls [devtoolsWarning] is the same for both - // themes, we will use the same border color. - borderColor: Colors.black.withOpacity(0.12), + borderColor: theme.focusColor, children: [ Container( height: defaultButtonHeight, diff --git a/packages/devtools_app/lib/src/screens/inspector/layout_explorer/ui/utils.dart b/packages/devtools_app/lib/src/screens/inspector/layout_explorer/ui/utils.dart index fe5284f596a..c8bcc4de9e6 100644 --- a/packages/devtools_app/lib/src/screens/inspector/layout_explorer/ui/utils.dart +++ b/packages/devtools_app/lib/src/screens/inspector/layout_explorer/ui/utils.dart @@ -167,7 +167,7 @@ class WidgetVisualizer extends StatelessWidget { boxShadow: isSelected ? [ BoxShadow( - color: Colors.black.withOpacity(0.5), + color: Colors.black.withAlpha(255 ~/ 2), blurRadius: 20, ), ] diff --git a/packages/devtools_app/lib/src/screens/inspector_v2/layout_explorer/ui/utils.dart b/packages/devtools_app/lib/src/screens/inspector_v2/layout_explorer/ui/utils.dart index ce472ac1b25..c55b972ac29 100644 --- a/packages/devtools_app/lib/src/screens/inspector_v2/layout_explorer/ui/utils.dart +++ b/packages/devtools_app/lib/src/screens/inspector_v2/layout_explorer/ui/utils.dart @@ -168,7 +168,7 @@ class WidgetVisualizer extends StatelessWidget { boxShadow: isSelected ? [ BoxShadow( - color: Colors.black.withOpacity(0.5), + color: Colors.black.withAlpha(255 ~/ 2), blurRadius: 10, ), ] diff --git a/packages/devtools_app/lib/src/shared/common_widgets.dart b/packages/devtools_app/lib/src/shared/common_widgets.dart index 87da35e202d..4950b4f9345 100644 --- a/packages/devtools_app/lib/src/shared/common_widgets.dart +++ b/packages/devtools_app/lib/src/shared/common_widgets.dart @@ -894,10 +894,10 @@ extension ColorExtension on Color { final c = this; return Color.fromARGB( - c.alpha, - (c.red * percent).round(), - (c.green * percent).round(), - (c.blue * percent).round(), + c.a.round(), + (c.r * percent).round(), + (c.g * percent).round(), + (c.b * percent).round(), ); } @@ -907,10 +907,10 @@ extension ColorExtension on Color { final c = this; return Color.fromARGB( - c.alpha, - c.red + ((255 - c.red) * percent).round(), - c.green + ((255 - c.green) * percent).round(), - c.blue + ((255 - c.blue) * percent).round(), + c.a.round(), + (c.r + ((255 - c.r) * percent)).round(), + (c.g + ((255 - c.g) * percent)).round(), + (c.b + ((255 - c.b) * percent)).round(), ); } } diff --git a/packages/devtools_app/test/shared/table_test.dart b/packages/devtools_app/test/shared/table_test.dart index a528467fccd..adef8c6f0f0 100644 --- a/packages/devtools_app/test/shared/table_test.dart +++ b/packages/devtools_app/test/shared/table_test.dart @@ -1639,10 +1639,11 @@ void main() { final snapFinder = find.byKey(const Key('Snap')); final crackleFinder = find.byKey(const Key('Crackle')); - // Expected values returned through accessing Color.value property. - const color1Value = 4294111476; - const color2Value = 4294967295; - const rowSelectedColorValue = 4294967295; + // Expected ARGB color values. + const color1Value = + '(a: 1.0, r: 0.9490196078431372, g: 0.9411764705882353, b: 0.9568627450980393)'; + const color2Value = '(a: 1.0, r: 1.0, g: 1.0, b: 1.0)'; + const rowSelectedColorValue = '(a: 1.0, r: 1.0, g: 1.0, b: 1.0)'; await tester.pumpWidget(wrap(table)); await tester.pumpAndSettle(); @@ -1661,12 +1662,12 @@ void main() { final TableRow snapRow = tester.widget(snapFinder); TableRow crackleRow = tester.widget(crackleFinder); - expect(fooRow.backgroundColor!.value, color1Value); - expect(barRow.backgroundColor!.value, color2Value); - expect(bazRow.backgroundColor!.value, color1Value); - expect(quxRow.backgroundColor!.value, color2Value); - expect(snapRow.backgroundColor!.value, color1Value); - expect(crackleRow.backgroundColor!.value, color2Value); + expect(fooRow.backgroundColor!.toArgbString(), color1Value); + expect(barRow.backgroundColor!.toArgbString(), color2Value); + expect(bazRow.backgroundColor!.toArgbString(), color1Value); + expect(quxRow.backgroundColor!.toArgbString(), color2Value); + expect(snapRow.backgroundColor!.toArgbString(), color1Value); + expect(crackleRow.backgroundColor!.toArgbString(), color2Value); await tester.tap(barFinder); await tester.pumpAndSettle(); @@ -1680,12 +1681,12 @@ void main() { barRow = tester.widget(barFinder); crackleRow = tester.widget(crackleFinder); - expect(fooRow.backgroundColor!.value, color1Value); + expect(fooRow.backgroundColor!.toArgbString(), color1Value); // [barRow] has the rowSelected color after being tapped. - expect(barRow.backgroundColor!.value, rowSelectedColorValue); + expect(barRow.backgroundColor!.toArgbString(), rowSelectedColorValue); // [crackleRow] has a different background color after collapsing previous // row (Bar). - expect(crackleRow.backgroundColor!.value, color1Value); + expect(crackleRow.backgroundColor!.toArgbString(), color1Value); }, ); @@ -1837,3 +1838,9 @@ class _VeryWideMinWidthColumn extends ColumnData { @override bool get supportsSorting => false; } + +extension on Color { + String toArgbString() { + return '(a: $a, r: $r, g: $g, b: $b)'; + } +} diff --git a/packages/devtools_app_shared/lib/src/ui/theme/theme.dart b/packages/devtools_app_shared/lib/src/ui/theme/theme.dart index 234b7a365bc..1dbe07d8779 100644 --- a/packages/devtools_app_shared/lib/src/ui/theme/theme.dart +++ b/packages/devtools_app_shared/lib/src/ui/theme/theme.dart @@ -2,6 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +// TODO(kenz): remove once min flutter version of devtools_app_shared >= 3.25 +// ignore_for_file: deprecated_member_use, analysis performed with newer flutter version than min sdk + import 'package:flutter/material.dart'; import '../ui_utils.dart'; diff --git a/packages/devtools_app_shared/lib/src/utils/utils.dart b/packages/devtools_app_shared/lib/src/utils/utils.dart index c4c21f664df..3122a7ee152 100644 --- a/packages/devtools_app_shared/lib/src/utils/utils.dart +++ b/packages/devtools_app_shared/lib/src/utils/utils.dart @@ -2,6 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +// TODO(kenz): remove once min flutter version of devtools_app_shared >= 3.25 +// ignore_for_file: deprecated_member_use, analysis performed with newer flutter version than min sdk + import 'dart:async'; import 'dart:math';