flutter_architecture_samples icon indicating copy to clipboard operation
flutter_architecture_samples copied to clipboard

Redux Listview rebuild all TodoList, but only repaint one TodoItem

Open WingCH opened this issue 5 years ago • 0 comments

Hi, i am learning Redux, your sample is very helpful.

But I have some questions and hope to answer them...

In redux sample, when i click Checkbox, StoreConnector(FilteredTodos) will return whole TodoList, ListView.builder(TodoList) will rebuild all TodoItem, so i thinks the all TodoItem should be rebuilded.

However, in reality, when i open Flutter inspector - Repaint Rainbow this can Shows rotating colors on layers when repainting., according to photo only TodoItem that are clcik will be repainted.

I tried deleting 'key', but the result is the same.

In When to Use Keys - Flutter Widgets 101 Ep. 4, Statless Widget only will compared the type and key to update widget, I don't know why it only rebuild one TodoItem rather than all 'TodoItem'.

image

WingCH avatar Feb 16 '20 14:02 WingCH