Managing FlutterFlow List State and Stable Item IdentityManaging FlutterFlow List State and Stable Item Identity
The network for creativity
Join 1.25M professional creatives like you
Connect with clients, get discovered, and run your business 100% commission-free
Creatives on Contra have earned over $150M and we are just getting started
A list card in FlutterFlow can carry three values that look alike and belong in three different places: whether the card is expanded, whether the task is a favorite, and which task the side panel shows. Mixing them up is why one row's state turns up on another after a refresh. Expanded is display state for one instance, so component state fits and a reset is acceptable. A favorite is a fact about the task, so it belongs in a field on that document. The selected task is one page-wide choice, so page state holds it as a document reference, not a list index. Identity is the other half. Without a key, Flutter matches rebuilt rows by type and position, so state sitting at index 1 stays there and lands on whatever record moved into it. The ValueKey documentation recommends a stable identifier from the data model, such as a Firestore document ID. Set one card's state, move that card to the top, and watch where the state goes. https://www.duskolicanin.com/blog/flutterflow-component-state-list-reuse
Post image
Back to feed
The network for creativity
Join 1.25M professional creatives like you
Connect with clients, get discovered, and run your business 100% commission-free
Creatives on Contra have earned over $150M and we are just getting started