Improve 'NestedScrollView and internal scrolling' test to account for all the inner children layers (#102309)

This commit is contained in:
Taha Tesser 2022-04-21 20:39:09 +03:00 committed by GitHub
parent a9eaee55ea
commit e4edcbceb3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -599,11 +599,17 @@ void main() {
return child; return child;
} }
if (child is ContainerLayer) { if (child is ContainerLayer) {
final PhysicalModelLayer? candidate = _dfsFindPhysicalLayer(child); Layer? innerChild = child.firstChild;
while (innerChild != null) {
if (innerChild is ContainerLayer) {
final PhysicalModelLayer? candidate = _dfsFindPhysicalLayer(innerChild);
if (candidate != null) { if (candidate != null) {
return candidate; return candidate;
} }
} }
innerChild = innerChild.nextSibling;
}
}
child = child.nextSibling; child = child.nextSibling;
} }
return null; return null;