title: Flutter, How to solve "RenderBox was not laid out: ... NEEDS-PAINT"
body: <p>I am trying to show a list using <code>GridView.builder</code> and showing one child in each row... Here is the part of the code:</p>
  <pre><code>SafeArea(
          child: Column(
            children: [
              Header(),
              SizedBox(height: 20),
              Expanded(child: SingleChildScrollView(child: Konten())),
  
            ],
          ),
        )
  </code></pre>
  <p>and code for <code>Konten()</code>:</p>
  <pre><code>Padding(
        padding: const EdgeInsets.all(10),
        child: GridView.builder(
          physics: NeverScrollableScrollPhysics(),
          shrinkWrap: true,
          itemCount: data.length,
          gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
              crossAxisCount: 1,
              crossAxisSpacing: 16,
              mainAxisSpacing: 16,
              childAspectRatio:
                  10
              ),
          itemBuilder: (context, index) =&gt; Container(
            alignment: Alignment.center,
            child: Text(data[index][&quot;API&quot;]),
            decoration: BoxDecoration(
                color: Colors.amber, borderRadius: BorderRadius.circular(15)),
          ),
        ),
      )
  </code></pre>
  <p>but I get this error:</p>
  <pre><code>════════ Exception caught by rendering library ═════════════════════════════════
  Assertion failed:
  ../…/rendering/box.dart:1930
  hasSize
  &quot;RenderBox was not laid out: RenderRepaintBoundary#0992d relayoutBoundary=up3 NEEDS-PAINT&quot;
  
  The relevant error-causing widget was
  Column
  lib/screen_utama.dart:18
  ════════════════════════════════════════════════════════════════════════════════
  </code></pre>
  <p>list of <code>data</code> that I used is data from api... but when I change the data become this one, that doesn't show the error:</p>
  <pre><code>List data=List.generate(10, (index) =&gt; {&quot;id&quot;: index, &quot;name&quot;: &quot;Lowongan $index&quot;})
        .toList();
  </code></pre>
  <p>is There a way to solve this problem?</p>