RepaintBoundary
- RepaintBoundary子树repaint的时候,父widget和RepaintBoundary子树会被repaint,但是与RepaintBoundary子树同级的其他子树不会被repaint
- 如果父widget repaint,则RepaintBoundary子树也会repaint
- 如果非RepaintBoundary子树repaint,则也会引起浮widget repaint,导致RepaintBoundary子树也repaint
RelayoutBoundary
renderObject在layout阶段做了Relayout boundary的优化,当子树进行relayout时,满足下面三种中的一种
- parentUsesSize == false
- sizedByParent == true
- constraints.isTight
那么该renderObject设置为Relayout boundary,也就是该renderObject的重新layout不触发parent的layout,一般情况下开发人员不需要关心Relayout boundary,除非是使用CustomMultiChildLayout
网友评论