From fc52858bdcf98d22546343613b93925b8deba2a8 Mon Sep 17 00:00:00 2001 From: Shi Hao Hong Date: Wed, 27 May 2020 10:23:20 -0700 Subject: [PATCH 1/2] Fix _getScrimColor to look for ColoredBox post-migration --- packages/animations/test/open_container_test.dart | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/packages/animations/test/open_container_test.dart b/packages/animations/test/open_container_test.dart index bd0fb3975ebb..571c77db7d1a 100644 --- a/packages/animations/test/open_container_test.dart +++ b/packages/animations/test/open_container_test.dart @@ -1601,13 +1601,8 @@ void main() { } Color _getScrimColor(WidgetTester tester) { - // TODO(dnfield): fix this after https://github.com/flutter/flutter/pull/50979 - final Container container = tester.widget(find.byType(Container)); - if (container.decoration != null) { - final BoxDecoration decoration = container.decoration; - return decoration.color; - } - return (container as dynamic).color; + final ColoredBox coloredBox = tester.widget(find.byType(ColoredBox)); + return coloredBox.color; } void _expectMaterialPropertiesHaveAdvanced({ From b340782f1807f30c4de66640cf206d18066d92c5 Mon Sep 17 00:00:00 2001 From: Shi Hao Hong Date: Wed, 27 May 2020 10:24:51 -0700 Subject: [PATCH 2/2] Condense to single line --- packages/animations/test/open_container_test.dart | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/animations/test/open_container_test.dart b/packages/animations/test/open_container_test.dart index 571c77db7d1a..41acd5030d7e 100644 --- a/packages/animations/test/open_container_test.dart +++ b/packages/animations/test/open_container_test.dart @@ -1601,8 +1601,7 @@ void main() { } Color _getScrimColor(WidgetTester tester) { - final ColoredBox coloredBox = tester.widget(find.byType(ColoredBox)); - return coloredBox.color; + return tester.widget(find.byType(ColoredBox)).color; } void _expectMaterialPropertiesHaveAdvanced({