Skip to content

RenderSliverFixedExtentBoxAdaptor.performLayout is not working correctly #30526

Closed

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.

Activity

  1. added
    frameworkflutter/packages/flutter repository. See also f: labels.
    on Apr 4, 2019
  2. self-assigned this
    on Jul 16, 2019
  3. github-actions commented on Aug 29, 2021

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  4. locked as resolved and limited conversation to collaborators on Aug 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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