Hi,
I'm facing a problem with ListView.builder,
using itemBuilder to build a StatefulWidget as a ListItem.
The problem is that after changing the list (removing item from the middle, adding at 0 index, etc...)
the props on the ListItems are all wrong.
Examples
* Adding:
-- LIST --
1. A
2. B
Adding C:
* Removing:
-- LIST --
1. A
2. B
3. C
Removing 2. B:
-- LIST --
1. A
2. B
After debugging I find out that although the array of items is order correctly (as the example [A,B,C] => removing => [A,C]),
the itemBuilder is iterating again over the list of item but when creating the new ItemStatefulWidget passing in the correct item,
the createState of the StatefulWidget isn't get called again...
Is there anyway to force a recreation of the state,
Are there any good practices for Stateful ListItems?
Thanks in advance,
Idan