markNeedsPaint method
void
markNeedsPaint()
inherited
Mark this render object as needing to be repainted.
This will cause paint to be called during the next paint pass.
The paint request propagates up to the root on first mark, where it
requests a visual update. Subsequent calls while already dirty
short-circuit after re-requesting a visual update (same frame-skip
concern as markNeedsLayout).
Implementation
void markNeedsPaint() {
if (_needsPaint) {
owner?.requestVisualUpdate();
return;
}
_needsPaint = true;
if (parent != null) {
// Continue propagation up the tree
parent!.markNeedsPaint();
} else {
// We're the root - always request visual update to ensure a frame
// gets scheduled, even if the flag was already set
owner?.requestVisualUpdate();
}
}