Issue
I am using Redux with Flutter for state management. Whenever I dispatch an action, I want to know which widgets were re-rendered. Is there any way of doing it?
Solution
In flutter, whenever one widget update ; the whole widget tree repaint. So... no.
But you can also introduce "repaint boundaries" manually by inserting in your tree a RepaintBoundary
widget. This explicitly tells flutter to create a new painting layer for it's child (which implies memory cache). So that whenever that child updates, it won't repaint it's parent too.
What you can do is instead debug when a RepaintBoundary is repainted.
For this you can enable repaint rainbow by:
- Pressing
t
when usingflutter run
- Using vscode
Dart Code
extension with actrl/cmd + shift + p
andenable repaint rainbow
Answered By - Rémi Rousselet
Answer Checked By - Timothy Miller (JavaFixing Admin)