Skip to content

Commit 7c99f8f

Browse files
TahaTesseregramond
authored andcommitted
Improve 'NestedScrollView and internal scrolling' test to account for all the inner children layers (flutter#102309)
1 parent 18a49ca commit 7c99f8f

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

packages/flutter/test/widgets/nested_scroll_view_test.dart

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -599,9 +599,15 @@ void main() {
599599
return child;
600600
}
601601
if (child is ContainerLayer) {
602-
final PhysicalModelLayer? candidate = _dfsFindPhysicalLayer(child);
603-
if (candidate != null) {
604-
return candidate;
602+
Layer? innerChild = child.firstChild;
603+
while (innerChild != null) {
604+
if (innerChild is ContainerLayer) {
605+
final PhysicalModelLayer? candidate = _dfsFindPhysicalLayer(innerChild);
606+
if (candidate != null) {
607+
return candidate;
608+
}
609+
}
610+
innerChild = innerChild.nextSibling;
605611
}
606612
}
607613
child = child.nextSibling;

0 commit comments

Comments
 (0)