ADVANCED FLUTTER

Render Objects

Learn the foundation of Flutter's rendering layer. Master the primitives that paint every pixel on the screen.

my_render_box.dart
class MyRenderBox extends RenderBox {
  @override
  void setupParentData(RenderObject child) { /**/ }

  @override
  void performLayout() { /**/ }

  @override
  bool hitTest(BoxHitTestResult result, {required Offset position}) { /**/ }

  @override
  void paint(PaintingContext ctx, Offset offset) { /**/ }

  @override
  void describeSemanticsConfiguration(SemanticsConfiguration config) { /**/ }

  @override
  void debugFillProperties(DiagnosticPropertiesBuilder properties) { /**/ }
}
Matt Carroll
Need help? Hire the author
Appreciate these docs? Sponsor the author
20guides
16api docs
5examples
1render kit

Render Object Guides

With AI, you can outsource your knowledge, but not your understanding. Learn the fundamental behaviors of render objects with our guides.

View all guides →

Surgical Help

Get help implementing specific render object methods with our API docs.

performLayout() docs →

Calculates the size of this render object and positions all its children. Must set this.size before returning.

void — called by the framework during the layout phase
paint(PaintingContext context, Offset offset) docs →

Draws the visual representation of this render object onto the composited layer. Called after layout completes.

void — uses context.canvas for direct drawing operations
hitTest(BoxHitTestResult result, {required Offset position}) docs →

Determines whether a pointer event at position falls within this render object. Returns true to claim the event.

bool — true if the hit test is absorbed by this render object
View full API reference →