From b1f5fe93172bfe99b311ffb5558f627675a8a017 Mon Sep 17 00:00:00 2001 From: Nate Wilson Date: Wed, 19 Jun 2024 17:28:15 -0600 Subject: [PATCH 1/2] change `Material` elements to `StatelessElement`s --- .../animations/test/open_container_test.dart | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/animations/test/open_container_test.dart b/packages/animations/test/open_container_test.dart index 4b7f2f854671..eee423f1eaab 100644 --- a/packages/animations/test/open_container_test.dart +++ b/packages/animations/test/open_container_test.dart @@ -37,7 +37,7 @@ void main() { )); // Closed container has the expected properties. - final StatefulElement srcMaterialElement = tester.firstElement( + final StatelessElement srcMaterialElement = tester.firstElement( find.ancestor( of: find.text('Closed'), matching: find.byType(Material), @@ -62,7 +62,7 @@ void main() { await tester.pump(); // On the first frame of the animation everything still looks like before. - final StatefulElement destMaterialElement = tester.firstElement( + final StatelessElement destMaterialElement = tester.firstElement( find.ancestor( of: find.text('Closed'), matching: find.byType(Material), @@ -162,7 +162,7 @@ void main() { await tester.pump(const Duration(milliseconds: 1)); expect(find.text('Closed'), findsNothing); // No longer in the tree. expect(find.text('Open'), findsOneWidget); - final StatefulElement finalMaterialElement = tester.firstElement( + final StatelessElement finalMaterialElement = tester.firstElement( find.ancestor( of: find.text('Open'), matching: find.byType(Material), @@ -213,7 +213,7 @@ void main() { // Open container has the expected properties. expect(find.text('Closed'), findsNothing); expect(find.text('Open'), findsOneWidget); - final StatefulElement initialMaterialElement = tester.firstElement( + final StatelessElement initialMaterialElement = tester.firstElement( find.ancestor( of: find.text('Open'), matching: find.byType(Material), @@ -237,7 +237,7 @@ void main() { expect(find.text('Closed'), findsOneWidget); expect(find.text('Open'), findsOneWidget); - final StatefulElement materialElement = tester.firstElement( + final StatelessElement materialElement = tester.firstElement( find.ancestor( of: find.text('Open'), matching: find.byType(Material), @@ -328,7 +328,7 @@ void main() { await tester.pump(const Duration(milliseconds: 1)); expect(find.text('Open'), findsNothing); // No longer in the tree. expect(find.text('Closed'), findsOneWidget); - final StatefulElement finalMaterialElement = tester.firstElement( + final StatelessElement finalMaterialElement = tester.firstElement( find.ancestor( of: find.text('Closed'), matching: find.byType(Material), @@ -380,7 +380,7 @@ void main() { )); // Closed container has the expected properties. - final StatefulElement srcMaterialElement = tester.firstElement( + final StatelessElement srcMaterialElement = tester.firstElement( find.ancestor( of: find.text('Closed'), matching: find.byType(Material), @@ -405,7 +405,7 @@ void main() { await tester.pump(); // On the first frame of the animation everything still looks like before. - final StatefulElement destMaterialElement = tester.firstElement( + final StatelessElement destMaterialElement = tester.firstElement( find.ancestor( of: find.text('Closed'), matching: find.byType(Material), @@ -509,7 +509,7 @@ void main() { await tester.pump(const Duration(milliseconds: 1)); expect(find.text('Closed'), findsNothing); // No longer in the tree. expect(find.text('Open'), findsOneWidget); - final StatefulElement finalMaterialElement = tester.firstElement( + final StatelessElement finalMaterialElement = tester.firstElement( find.ancestor( of: find.text('Open'), matching: find.byType(Material), @@ -558,7 +558,7 @@ void main() { // Open container has the expected properties. expect(find.text('Closed'), findsNothing); expect(find.text('Open'), findsOneWidget); - final StatefulElement initialMaterialElement = tester.firstElement( + final StatelessElement initialMaterialElement = tester.firstElement( find.ancestor( of: find.text('Open'), matching: find.byType(Material), @@ -583,7 +583,7 @@ void main() { expect(find.text('Closed'), findsOneWidget); expect(find.text('Open'), findsOneWidget); - final StatefulElement materialElement = tester.firstElement( + final StatelessElement materialElement = tester.firstElement( find.ancestor( of: find.text('Open'), matching: find.byType(Material), @@ -684,7 +684,7 @@ void main() { await tester.pump(const Duration(milliseconds: 1)); expect(find.text('Open'), findsNothing); // No longer in the tree. expect(find.text('Closed'), findsOneWidget); - final StatefulElement finalMaterialElement = tester.firstElement( + final StatelessElement finalMaterialElement = tester.firstElement( find.ancestor( of: find.text('Closed'), matching: find.byType(Material), From b605451a2b08d036da5d13e78f358d6a91e219fc Mon Sep 17 00:00:00 2001 From: Nate Wilson Date: Thu, 8 Aug 2024 13:56:38 -0600 Subject: [PATCH 2/2] use `Element` type --- .../animations/test/open_container_test.dart | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/animations/test/open_container_test.dart b/packages/animations/test/open_container_test.dart index eee423f1eaab..5d4ae9614180 100644 --- a/packages/animations/test/open_container_test.dart +++ b/packages/animations/test/open_container_test.dart @@ -37,7 +37,7 @@ void main() { )); // Closed container has the expected properties. - final StatelessElement srcMaterialElement = tester.firstElement( + final Element srcMaterialElement = tester.firstElement( find.ancestor( of: find.text('Closed'), matching: find.byType(Material), @@ -62,7 +62,7 @@ void main() { await tester.pump(); // On the first frame of the animation everything still looks like before. - final StatelessElement destMaterialElement = tester.firstElement( + final Element destMaterialElement = tester.firstElement( find.ancestor( of: find.text('Closed'), matching: find.byType(Material), @@ -162,7 +162,7 @@ void main() { await tester.pump(const Duration(milliseconds: 1)); expect(find.text('Closed'), findsNothing); // No longer in the tree. expect(find.text('Open'), findsOneWidget); - final StatelessElement finalMaterialElement = tester.firstElement( + final Element finalMaterialElement = tester.firstElement( find.ancestor( of: find.text('Open'), matching: find.byType(Material), @@ -213,7 +213,7 @@ void main() { // Open container has the expected properties. expect(find.text('Closed'), findsNothing); expect(find.text('Open'), findsOneWidget); - final StatelessElement initialMaterialElement = tester.firstElement( + final Element initialMaterialElement = tester.firstElement( find.ancestor( of: find.text('Open'), matching: find.byType(Material), @@ -237,7 +237,7 @@ void main() { expect(find.text('Closed'), findsOneWidget); expect(find.text('Open'), findsOneWidget); - final StatelessElement materialElement = tester.firstElement( + final Element materialElement = tester.firstElement( find.ancestor( of: find.text('Open'), matching: find.byType(Material), @@ -328,7 +328,7 @@ void main() { await tester.pump(const Duration(milliseconds: 1)); expect(find.text('Open'), findsNothing); // No longer in the tree. expect(find.text('Closed'), findsOneWidget); - final StatelessElement finalMaterialElement = tester.firstElement( + final Element finalMaterialElement = tester.firstElement( find.ancestor( of: find.text('Closed'), matching: find.byType(Material), @@ -380,7 +380,7 @@ void main() { )); // Closed container has the expected properties. - final StatelessElement srcMaterialElement = tester.firstElement( + final Element srcMaterialElement = tester.firstElement( find.ancestor( of: find.text('Closed'), matching: find.byType(Material), @@ -405,7 +405,7 @@ void main() { await tester.pump(); // On the first frame of the animation everything still looks like before. - final StatelessElement destMaterialElement = tester.firstElement( + final Element destMaterialElement = tester.firstElement( find.ancestor( of: find.text('Closed'), matching: find.byType(Material), @@ -509,7 +509,7 @@ void main() { await tester.pump(const Duration(milliseconds: 1)); expect(find.text('Closed'), findsNothing); // No longer in the tree. expect(find.text('Open'), findsOneWidget); - final StatelessElement finalMaterialElement = tester.firstElement( + final Element finalMaterialElement = tester.firstElement( find.ancestor( of: find.text('Open'), matching: find.byType(Material), @@ -558,7 +558,7 @@ void main() { // Open container has the expected properties. expect(find.text('Closed'), findsNothing); expect(find.text('Open'), findsOneWidget); - final StatelessElement initialMaterialElement = tester.firstElement( + final Element initialMaterialElement = tester.firstElement( find.ancestor( of: find.text('Open'), matching: find.byType(Material), @@ -583,7 +583,7 @@ void main() { expect(find.text('Closed'), findsOneWidget); expect(find.text('Open'), findsOneWidget); - final StatelessElement materialElement = tester.firstElement( + final Element materialElement = tester.firstElement( find.ancestor( of: find.text('Open'), matching: find.byType(Material), @@ -684,7 +684,7 @@ void main() { await tester.pump(const Duration(milliseconds: 1)); expect(find.text('Open'), findsNothing); // No longer in the tree. expect(find.text('Closed'), findsOneWidget); - final StatelessElement finalMaterialElement = tester.firstElement( + final Element finalMaterialElement = tester.firstElement( find.ancestor( of: find.text('Closed'), matching: find.byType(Material),