skip to Main Content

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?

2

Answers


  1. Try to user Equatable Mixin for your child widget. https://pub.dev/packages/equatable

    Login or Signup to reply.
  2. Use the setState method for updating the list item builder. Reference

     setState(() {
                      items[index].checked = value!;
                    });
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search