title: Flutter - Add GridView without specify a container height
body: <p>I'm having troubles setting a <code>GridView</code> that should show some buttons to allow user to choose an hour to book.<br />
  This is my <code>GridView</code> code:</p>
  <pre><code>GridView.count(
      childAspectRatio: 3 / 2,
      crossAxisCount: 3,
      mainAxisSpacing: 4.0,
      crossAxisSpacing: 16.0,
      physics: NeverScrollableScrollPhysics(),
      children: &lt;Widget&gt;[
          ...currentVariations.map((element) {
              return HourButton(
                  firstRow: 'ore',
                  secondRow: element.orario,
                  active: element.id == variationId,
                  onPressed: (){}
               );
          }).toList()                              
      ],
   )
  </code></pre>
  <p>My screen has a <code>CustomScrollView</code> with <code>SliverAppBar</code> and a <code>SliverList</code> in which I have a <code>SliverChildListDelegate</code> that contains a Column with all my widgets.</p>
  <p>The problem is that if I add the GridView as above it do not appear on screen so to make it visibile I have added this:</p>
  <pre><code>Container(
      height: 120,
      child: MediaQuery.removePadding(
        context: context,
        removeTop: true,
        child: GridView.count(
          childAspectRatio: 3 / 2,
          crossAxisCount: 3,
          mainAxisSpacing: 4.0,
          crossAxisSpacing: 16.0,
          physics: NeverScrollableScrollPhysics(),
          children: &lt;Widget&gt;[
            ...currentVariations.map((element) {
              return HourButton(
                firstRow: 'ore',
                secondRow: element.orario,
                active: element.id == variationId,
                onPressed: (){},
              );
            }).toList()
          ],
        ),
      ),
    ),
  </code></pre>
  <p>With the <code>Container</code> and <code>MediaQuery.removePadding</code> it shows but in this way I need to set the <code>Container</code> height to see the list.</p>
  <p>This is the result:</p>
  <p><a href="https://i.stack.imgur.com/RcaCR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RcaCR.png" alt="enter image description here" /></a></p>
  <p>How can I make the container height automatic?</p>