title: Flutter sizing of constrained box to its maxHeight resp. minHeight
body: <p>I have a ConstrainedBox with minHeight 50 and maxHeight 400. The CB contains a Container that colors itself yellow.</p>
  
  <p>Note that CB here serves as an abstraction. Basically, that CB might be any kind of widget that has min/max constraints.</p>
  
  <p>Now I have two scenarios:</p>
  
  <ul>
  <li><p>I want to make the CB as big as possible (take maxHeight).</p></li>
  <li><p>I want to make the CB as small as possible (take minHeight).</p></li>
  </ul>
  
  <p>I tried</p>
  
  <pre><code>Widget build(BuildContext _) =&gt; Scaffold(
        backgroundColor: Colors.transparent,
        body: SizedBox.expand(
            child: ConstrainedBox(
                constraints: BoxConstraints(minHeight: 50, maxHeight: 400),
                child: Container(color: Colors.yellow))));
  </code></pre>
  
  <p>which shows a fullscreen yellow box, but I want 400 pixels!</p>
  
  <pre><code>  Widget build(BuildContext _) =&gt; Scaffold(
        backgroundColor: Colors.transparent,
        body: SizedBox.shrink(
            child: ConstrainedBox(
                constraints: BoxConstraints(minHeight: 50, maxHeight: 400),
                child: Container(color: Colors.yellow))));
  </code></pre>
  
  <p>which results in an empty Scaffold, but I want 50 pixels!</p>
  
  <p>EDIT: I solved the problem, please see my own answer.</p>