From e4edcbceb388c79fc2002a1b84159dab5f41c5e5 Mon Sep 17 00:00:00 2001 From: Taha Tesser Date: Thu, 21 Apr 2022 20:39:09 +0300 Subject: [PATCH] Improve 'NestedScrollView and internal scrolling' test to account for all the inner children layers (#102309) --- .../test/widgets/nested_scroll_view_test.dart | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/flutter/test/widgets/nested_scroll_view_test.dart b/packages/flutter/test/widgets/nested_scroll_view_test.dart index 212e86428e..62a257e38d 100644 --- a/packages/flutter/test/widgets/nested_scroll_view_test.dart +++ b/packages/flutter/test/widgets/nested_scroll_view_test.dart @@ -599,9 +599,15 @@ void main() { return child; } if (child is ContainerLayer) { - final PhysicalModelLayer? candidate = _dfsFindPhysicalLayer(child); - if (candidate != null) { - return candidate; + Layer? innerChild = child.firstChild; + while (innerChild != null) { + if (innerChild is ContainerLayer) { + final PhysicalModelLayer? candidate = _dfsFindPhysicalLayer(innerChild); + if (candidate != null) { + return candidate; + } + } + innerChild = innerChild.nextSibling; } } child = child.nextSibling;