RepaintBoundary cô lập một subtree để nó vẽ lại độc lập mà không ảnh hưởng toàn bộ cây.
- Dùng nó xung quanh widget vẽ lại thường xuyên (animation, progress indicator).
- Khi con của
RepaintBoundarythay đổi, chỉ subtree đó mới vẽ lại. - Lạm dụng tạo quá nhiều boundary và giảm hiệu năng; chỉ dùng tiết kiệm cho các điểm hot đã được xác định.
RepaintBoundary isolates a subtree so it repaints independently without affecting the entire tree.
- Use it around widgets that repaint frequently like animations or progress indicators.
- Misuse creates too many boundaries and reduces performance; use sparingly only around known hot spots.