fixed section layout when scrolled offset gets beyond last section

This commit is contained in:
Thibault Deckers 2020-04-12 11:01:39 +09:00
parent 4e70eb9870
commit ddb282579d

View file

@ -53,7 +53,7 @@ class RenderSliverKnownExtentBoxAdaptor extends RenderSliverMultiBoxAdaptor {
}
int getMinChildIndexForScrollOffset(double scrollOffset) {
return sectionAtOffset(scrollOffset).getMinChildIndexForScrollOffset(scrollOffset);
return sectionAtOffset(scrollOffset)?.getMinChildIndexForScrollOffset(scrollOffset) ?? 0;
}
int getMaxChildIndexForScrollOffset(double scrollOffset) {