Commit bb238eba authored by Adam Barth's avatar Adam Barth Committed by Hans Muller

Fix typo in LazyBlock (#3594)

We were returning instead of breaking out of the loop when we hit the last
widget.

Fixes #3593
parent 620fb875
......@@ -616,7 +616,7 @@ class _LazyBlockElement extends RenderObjectElement {
newElement = inflateWidget(newWidget, previousChild);
}, building: true);
if (newElement == null)
return;
break;
_children.add(newElement);
}
child = _getNextWithin(block, child);
......
......@@ -279,4 +279,31 @@ void main() {
});
});
test('Underflow extents', () {
testWidgets((WidgetTester tester) {
double lastContentExtent;
double lastContainerExtent;
double lastMinScrollOffset;
void handleExtendsChanged(double contentExtent, double containerExtent, double minScrollOffset) {
lastContentExtent = contentExtent;
lastContainerExtent = containerExtent;
lastMinScrollOffset = minScrollOffset;
}
tester.pumpWidget(new LazyBlockViewport(
onExtentsChanged: handleExtendsChanged,
delegate: new LazyBlockChildren(
children: <Widget>[
new Container(height: 100.0),
new Container(height: 100.0),
new Container(height: 100.0),
]
)
));
expect(lastContentExtent, equals(300.0));
expect(lastContainerExtent, equals(600.0));
expect(lastMinScrollOffset, equals(0.0));
});
});
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment