title: How to make a container take up the height of the parent widget?
body: <p>I have a card layout which looks like the following:</p>
  <p><a href="https://i.stack.imgur.com/06P0g.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/06P0g.png" alt="Layout" /></a></p>
  <p>The code for it it as follows:</p>
  <pre><code>Card(
          color: tap ? Colors.green : Colors.white,
          margin: EdgeInsets.symmetric(horizontal: 5.0, vertical: 3.0),
          child: Container(
            child: Row(
              children: [
                **Container(
                  height: !widget.menuItem.image.endsWith('/')? 70.0 : 0.0,
                  width: !widget.menuItem.image.endsWith('/')? 70.0 : 0.0,
                  decoration: BoxDecoration(
                    borderRadius: BorderRadius.only(topLeft: Radius.circular(5.0), topRight: Radius.circular(5.0)),
                    image: DecorationImage(
                        image: NetworkImage(widget.menuItem.image),
                        fit: BoxFit.cover
                    ),
                  ),**
                ),
                SizedBox(
                  width: 8.0,
                ),
                Expanded(
                  child: Column(
                    mainAxisAlignment: MainAxisAlignment.center,
                    crossAxisAlignment: CrossAxisAlignment.start,
                    children: [
                      Row(
                        crossAxisAlignment: CrossAxisAlignment.baseline,
                        textBaseline: TextBaseline.alphabetic,
                        children: [
                          Text(
                            howManyThere() &gt; 0 ? &quot;${howManyThere()} x &quot; : '',
                            style: addBTNHighlight,
                          ),
                          Expanded(
                            child: Text(
                              widget.menuItem.item_name,
                              overflow: TextOverflow.ellipsis,
                              style: tap ? TitleWhite18Bold : Title18bold,
                            ),
                          ),
                        ],
                      ),
                      Container(
                        child: Text(
                          widget.menuItem.description,
                          //overflow: TextOverflow.ellipsis,
                          style: tap ? SubTitleWhite13 : SubTitle13,
                        ),
                      ),
                      Padding(
                        padding: const EdgeInsets.symmetric(vertical: 4.0),
                        child: Text(
                          &quot;£&quot; + num.parse(widget.menuItem.price).toStringAsFixed(2),
                          style: tap ? priceHighlightSelected : priceHighlight,
                        ),
                      ),
                    ],
                  ),
                ),
                Column(
                  crossAxisAlignment: CrossAxisAlignment.center,
                  children: [
                    Container(
                        padding: EdgeInsets.symmetric(horizontal: 30.0, vertical: 6.0),
                        decoration: BoxDecoration(),
                        child: Text(&quot;ADD&quot;, style: tap ? priceHighlightWhite : addBTNHighlight)),
                  ],
                ),
              ],
            ),
          ),
        )
  </code></pre>
  <p>As you can see that I am almost there with my desired layout but with one small issue which can be seen in first and last item. Because of the given width and height of the image container, it leaves a gap on top and bottom.</p>
  <p>What I would like to happen is that the width to stay the same but the height to be flexible and adjust with the height of the card itself. Is it possible?</p>
  <p>When I remove the height attribute of the container with the image, I get a blank space of the image</p>
  <p>UPDATE: I tried LayoutBuilder as well but without any Luck, it throws 'Incorrect use of ParentWidget' Exception. The code I used is as follows:</p>
  <pre><code>Row(
              children: [
                widget.menuItem.image.endsWith('/')
                    ? Container()
                    : **LayoutBuilder(
                  builder: (context, constraints){
                    return Container(
                      width: 70.0,
                      height: constraints.minHeight,
                      decoration: BoxDecoration(
                        borderRadius: BorderRadius.all(Radius.circular(5.0)),
                        image: DecorationImage(
                            image: NetworkImage(widget.menuItem.image),
                            fit: BoxFit.cover
                        ),
                      ),
                    );
                  }**
                ),
  </code></pre>