# FlutterError: RenderBox was not laid out: RenderRepaintBoundary#12345 relayoutBoundary=up1 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE

- **ID:** `flutter/render-box-intersect-error`
- **Domain:** flutter
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 85%

## Root Cause

A widget's RenderBox is accessed for geometry before it has been laid out, often due to calling RenderBox.size in initState or before the first frame.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| Flutter 3.7 | active | — | — |
| Flutter 3.10 | active | — | — |
| Dart 3.0 | active | — | — |

## Workarounds

1. **Delay RenderBox access until after the first frame using WidgetsBinding.instance.addPostFrameCallback and then access the GlobalKey's currentContext.size.** (85% success)
   ```
   Delay RenderBox access until after the first frame using WidgetsBinding.instance.addPostFrameCallback and then access the GlobalKey's currentContext.size.
   ```
2. **Use a LayoutBuilder to get constraints and size without directly accessing RenderBox.** (90% success)
   ```
   Use a LayoutBuilder to get constraints and size without directly accessing RenderBox.
   ```

## Dead Ends

- **** — SizedBox forces a size but does not ensure layout is complete before accessing RenderBox; the underlying widget may still not be laid out. (70% fail)
- **** — addPostFrameCallback runs after the first frame, but if accessed before the callback fires, the error persists. (50% fail)
- **** — The context may exist but the RenderBox may not be laid out yet; size is null until layout completes. (60% fail)
