title: Flutter - How to get Container with children to take up entire screen
body: <p>As per Flutter docs <code>Containers with no children try to be as big as possible unless the incoming constraints are unbounded, in which case they try to be as small as possible. Containers with children size themselves to their children.</code> The closest I've been to getting it to work:</p>
  
  <pre><code>return Stack(
    children: &lt;Widget&gt;[
      Container(
        width: MediaQuery.of(context).size.width,
        height: MediaQuery.of(context).size.height,
        //width: Device.screenWidth,
        //height: Device.screenHeight,
        child: Column(
          children: &lt;Widget&gt;[(view[1])],
        ),
      ),
      Container(
        width: MediaQuery.of(context).size.width * .50,
        height: MediaQuery.of(context).size.width * .50,
        child: Column(
          children: &lt;Widget&gt;[(view[0])],
        ),
      ),
    ],
  );
  
  
  I/flutter (12292): The following message was thrown during layout:
  I/flutter (12292): A RenderFlex overflowed by 81 pixels on the bottom.
  I/flutter (12292): The overflowing RenderFlex has an orientation of Axis.vertical.
  I/flutter (12292): The edge of the RenderFlex that is overflowing has been marked in the rendering with a yellow and
  I/flutter (12292): black striped pattern. This is usually caused by the contents being too big for the RenderFlex.
  </code></pre>
  
  <p>Can't understand why MediaQuery or Device isn't preventing overflow? The first Container always overflows by 81 pixels on both an Android phone or tablet; no iPhone or iPad to test now. Based on what I've read from other posts overflow with yellow &amp; black is corrected simply by wrapping in a SingleChildScrollView but when I attempt to do so I get</p>
  
  <pre><code>child: SingleChildScrollView(
          child: Column(
            children: &lt;Widget&gt;[(view[1])],
          ),
        ),
  
  I/flutter (12292): ══╡ EXCEPTION CAUGHT BY RENDERING LIBRARY ╞═════════════════════════════════════════════════════════
  I/flutter (12292): The following assertion was thrown during performLayout():
  I/flutter (12292): RenderFlex children have non-zero flex but incoming height constraints are unbounded.
  I/flutter (12292): When a column is in a parent that does not provide a finite height constraint, for example if it is
  I/flutter (12292): in a vertical scrollable, it will try to shrink-wrap its children along the vertical axis. Setting a
  I/flutter (12292): flex on a child (e.g. using Expanded) indicates that the child is to expand to fill the remaining
  I/flutter (12292): space in the vertical direction.
  I/flutter (12292): These two directives are mutually exclusive. If a parent is to shrink-wrap its child, the child
  .
  .
  .
  I/flutter (12292):   crossAxisAlignment: center
  I/flutter (12292):   verticalDirection: down
  I/flutter (12292): This RenderObject had the following child:
  I/flutter (12292):   RenderAndroidView#e356e NEEDS-LAYOUT NEEDS-PAINT
  </code></pre>
  
  <p>Made several other attempts with Expanded, ClipRect &amp; other widgets based on the errors I've seen but it just made it worse where there was no image at all. Am I missing something simple or should I attempt to fix this another way?</p>
  
  <p>EDIT: As per Amsakanna the latest attempt is below but still overflows by 81 pixels to produce identical error message above in the first code block.</p>
  
  <pre><code>return Stack(
    children: &lt;Widget&gt;[
      SingleChildScrollView(
        child: Container(
          width: MediaQuery.of(context).size.width,
          height: MediaQuery.of(context).size.height,
          child: Column(
            children: &lt;Widget&gt;[view[1])],
          ),
        ),
      ),
  
  I/flutter ( 1144): The following message was thrown during layout:
  I/flutter ( 1144): A RenderFlex overflowed by 81 pixels on the bottom.
  I/flutter ( 1144): The overflowing RenderFlex has an orientation of Axis.vertical.
  I/flutter ( 1144): The edge of the RenderFlex that is overflowing has been marked in the rendering with a yellow and
  I/flutter ( 1144): black striped pattern. This is usually caused by the contents being too big for the RenderFlex.
  </code></pre>
  
  <p>Tried to use IntrinsicHeight inside SingleChildScrollView as found <a href="https://docs.flutter.io/flutter/widgets/SingleChildScrollView-class.html" rel="noreferrer">here</a> in the <strong>Expanding content to fit the viewport</strong> section but it overflows too (by 81 pixels) with similar error message.</p>