Could you please explain to me at what point during the build the property of dirty changes its value?
Now I will explain what I mean:
When we call setState()
during the build, we will not see any effect - setState()
will not work. If we fall into the implementation of the setState()
, we will see that we call
markNeedsBuild()
in which we will just return method if dirty is true.
if (dirty) {
return;
}
_dirty = true;
owner!.scheduleBuildFor(this);
But during the build it will be true, and we can see this from the documentation:
Since it is inefficient to build an element twice in one frame, applications and widgets should be structured so as to only mark widgets dirty during event handlers before the frame begins, not during the build itself.
So my question is, at what specific point will dirty property become false? (if we didn't any changes to state)