bugfix: freeze when performing layout on collection list after scaling

This commit is contained in:
Thibault Deckers 2020-05-04 12:01:58 +09:00
parent 157fc60322
commit 6e53ce8cf3

View file

@ -46,18 +46,18 @@ class RenderSliverKnownExtentBoxAdaptor extends RenderSliverMultiBoxAdaptor {
SectionLayout sectionAtIndex(int index) => sectionLayouts.firstWhere((section) => section.hasChild(index), orElse: () => null);
SectionLayout sectionAtOffset(double scrollOffset) => sectionLayouts.firstWhere((section) => section.hasChildAtOffset(scrollOffset), orElse: () => null);
SectionLayout sectionAtOffset(double scrollOffset) => sectionLayouts.firstWhere((section) => section.hasChildAtOffset(scrollOffset), orElse: () => sectionLayouts.last);
double indexToLayoutOffset(int index) {
return (sectionAtIndex(index) ?? sectionLayouts.last).indexToLayoutOffset(index);
}
int getMinChildIndexForScrollOffset(double scrollOffset) {
return sectionAtOffset(scrollOffset)?.getMinChildIndexForScrollOffset(scrollOffset) ?? 0;
return sectionAtOffset(scrollOffset).getMinChildIndexForScrollOffset(scrollOffset);
}
int getMaxChildIndexForScrollOffset(double scrollOffset) {
return (sectionAtOffset(scrollOffset) ?? sectionLayouts.last).getMaxChildIndexForScrollOffset(scrollOffset);
return sectionAtOffset(scrollOffset).getMaxChildIndexForScrollOffset(scrollOffset);
}
double estimateMaxScrollOffset(