Skip to content

AnimatedList doesn't animate items when inserting or removing to an index that is offscreen. #74031

@adendiamond

Description

@adendiamond

Hi there,
I have found that AnimatedList doesn't animate items when inserting or removing to an index that is offscreen, i.e. when the surrounding widgets are destroyed (and the widget itself when removing it).

Here is a dartpad to explain:
https://dartpad.dev/3b8f07c4148c78a9284c7806a0608872?
(Please note that this isn't my code, I am having the same issue in my app, this code is from https://medium.com/flutter-community/updating-data-in-an-animatedlist-in-flutter-9dbfb136e515)

Steps to reproduce:

  • Click 'insert single item' 12 times.
  • Scroll to bottom
  • Click 'insert single item' once
    And observe how the behavior is identical to a normal ListView, no animation.

Any help is appreciated!

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listf: scrollingViewports, list views, slivers, etc.found in release: 3.7Found to occur in 3.7found in release: 3.9Found to occur in 3.9frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onteam-frameworkOwned by Framework teamtriaged-frameworkTriaged by Framework team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions