Flutter & Dart (50 Qs)•Part 2: Core Architecture & Implementation (Mid-Level)
What is `RepaintBoundary` and why is it used for animation performance?
senior LevelFormsPerformanceSystem Design
In Simple Words: By default, when a child widget repaints, its parent and sibling widgets on the same canvas may also be forced to repaint:
- Wrapping an animated widget in
RepaintBoundaryisolates it into a separate, cached display list layer. - When the animation runs, only the isolated layer repaints; the rest of the screen remains untouched, saving massive GPU rasterization time.