Skip to content

Stateful widget not being restored with ValueKey #16

@melio-matt

Description

@melio-matt

Hello
I've created a carousel by supplying an array of stateful widgets and when the provider signals, this will be reconstructed as part of the normal build process. On the rebuild and the array changing dimension I loose the state of my widgets, which do have ValueKeys on each. Switching the key to a GlobalKey means I retain the state, but there are obvious reasons for not wanting to use GlobalKeys.
I didn't find anything in the documentation about this, so I assumed that it should work the same way as other lists where the position of a widget can be changed using local keys.
regards
Matthew

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions