giorgio79
giorgio79

Reputation: 4209

Flutter AnimatedList - how to update an existing item?

AnimatedList has two methods, insert and delete for items in the list. https://api.flutter.dev/flutter/widgets/AnimatedList-class.html

In my case I have complex items, and their properties can change.

How would I update an existing item in an AnimatedList if a property changes without removing or inerting the whole item again?

Would it be a simple setState call?

Upvotes: 0

Views: 123

Answers (1)

harsh bangari
harsh bangari

Reputation: 495

Use the setState method for updating the list item builder. Reference

 setState(() {
                  items[index].checked = value!;
                });

Upvotes: 1

Related Questions