Skip to content

RenderSliverFixedExtentBoxAdaptor.performLayout is not working correctly #30526

@chunhtai

Description

@chunhtai

There are two issues in performLayout.

  1. Rounding error will cause the firstIndex to be off by 1.

getMinChildIndexForScrollOffset will sometimes return 2.9999999 or 1.999999999 which will be floor down to 2 or 1. This cause the layout try to create one additional child before the correct first child. This additional child will later be disposed since it later detects this child is no longer needed.

  1. LeadingGarbage and trailingGarbage is not calculated correctly in the case of jump or reordering.

ex: childList (0) -> (1) -> (5)
If targetLastIndex = 0, the trailingGarbage will be (5 - 0).clamp(0,3) = 3, where the correct trailingGarbage should be 2.
This will constantly remove the entire childList and later figures out it need to re-populate it back. Same thing for leadingGarbase.

Metadata

Metadata

Assignees

Labels

frameworkflutter/packages/flutter repository. See also f: labels.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions