Commit b2de3a70 authored by Adam Barth's avatar Adam Barth

Don't divide by zero

If there aren't any items, there's no point in computing which items to show.
parent 1867b58c
...@@ -439,7 +439,7 @@ abstract class ScrollableWidgetList extends Scrollable { ...@@ -439,7 +439,7 @@ abstract class ScrollableWidgetList extends Scrollable {
int itemShowCount = 0; int itemShowCount = 0;
Offset viewportOffset = Offset.zero; Offset viewportOffset = Offset.zero;
if (_containerExtent != null && _containerExtent > 0.0) { if (_containerExtent != null && _containerExtent > 0.0 && itemCount > 0) {
if (paddedScrollOffset < scrollBehavior.minScrollOffset) { if (paddedScrollOffset < scrollBehavior.minScrollOffset) {
// Underscroll // Underscroll
double visibleExtent = _containerExtent + paddedScrollOffset; double visibleExtent = _containerExtent + paddedScrollOffset;
......
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