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,9 +599,15 @@ void main() {
return child; return child;
} }
if (child is ContainerLayer) { if (child is ContainerLayer) {
final PhysicalModelLayer? candidate = _dfsFindPhysicalLayer(child); Layer? innerChild = child.firstChild;
if (candidate != null) { while (innerChild != null) {
return candidate; if (innerChild is ContainerLayer) {
final PhysicalModelLayer? candidate = _dfsFindPhysicalLayer(innerChild);
if (candidate != null) {
return candidate;
}
}
innerChild = innerChild.nextSibling;
} }
} }
child = child.nextSibling; child = child.nextSibling;