How does Flutter rebuild a subtree that has changed?

Viewed 30

I know it calls updateChild (or updatechildren) for each child from the root of the subtree that has changed, but how does this algorithm works? Say you have a Column with two children (w1, w2) and each of these again has a child (w1-1, w2-1). In what order does it update this w1-1 and w2-1? Where can I find the algorithm for this?

1 Answers

In your IDE, you can select any build() method, select "go to definition" via the right click menu, then from there select "go to references". A few of those will obviously be the code that calls the build(), which is what you're curious about. Have fun exploring the well-commented Flutter SDK!

Edit: that won't quite work, because the definition is right there. Instead, find "go to symbol" in your IDE, and go to "build", then "references".

Related