title: Flutter - Overlay container height problem
body: <p>I am using Overlay to render a <code>Container</code> that contains a <code>Listview</code> inside. When the user press '@' I display mention panel using <code>Overlay</code>, the problem is Container takes the height of the whole screen even though I have explicitly set it to <code>100.0</code>.</p>
  
  <p>I don't know if its a bug with flutter or I am doing something wrong here's a screenshot. Here's a simple <a href="https://dartpad.dartlang.org/b6409e10de32b280b8938aa75364fa7b" rel="nofollow noreferrer">dartpad example</a></p>
  
  <p><a href="https://i.stack.imgur.com/7y67O.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7y67O.png" alt="enter image description here"></a></p>
  
  <p>Here's the code that I using for the widget</p>
  
  <pre class="lang-dart prettyprint-override"><code>  Widget _buildSuggestionList() {
      return selected != -1
          ? Container(
              color: Colors.purple,
              height: 100.0,
              constraints: BoxConstraints(maxHeight: 100.0, minHeight: 80.0),
              child: ListView.builder(
                itemCount: widget.mentions[selected].data.length,
                itemBuilder: (context, index) {
                  final item = widget.mentions[selected].data[index];
  
                  return GestureDetector(
                    onTap: () {
                      if (this._overlayEntry != null) {
                        this._overlayEntry.remove();
  
                        this._overlayEntry = null;
                      }
  
                      final newText = "${_controller.value.text}${item["name"]} ";
  
                      _controller.text = newText;
  
                      setState(() {
                        text = newText;
                        selected = -1;
                      });
                    },
                    child: Text(
                      item["name"],
                      style: TextStyle(fontSize: 24.0, color: Colors.amber),
                    ),
                  );
                },
              ),
            )
          : null;
    }
  </code></pre>
  
  <p>Here's the overlay code:</p>
  
  <pre class="lang-dart prettyprint-override"><code>this._overlayEntry = OverlayEntry(builder: (_) {
       return CompositedTransformFollower(
           link: _layerLink,
           offset: Offset(0, -(size.height + 730.0)),
           child: _buildSuggestionList(),
       );
  }
  
  Overlay.of(key.currentContext).insert(_overlayEntry);
  </code></pre>
  
  <p>Here's my build function:</p>
  
  <pre class="lang-dart prettyprint-override"><code>  @override
    Widget build(BuildContext context) {
      return Container(
        key: key,
        width: MediaQuery.of(context).size.width,
        child: Stack(
          children: &lt;Widget&gt;[
            Positioned(
              child: Container(
                width: MediaQuery.of(context).size.width,
                padding: EdgeInsets.only(top: 12.0, left: 0.0),
                child: RichText(
                  maxLines: 20,
                  text: TextSpan(
                    text: text,
                    style: TextStyle(color: Colors.pink, fontSize: 16.0),
                  ),
                ),
              ),
            ),
            CompositedTransformTarget(
              link: _layerLink,
              child: TextField(
                maxLines: 20,
                minLines: 1,
                controller: _controller,
                decoration: InputDecoration(hintText: widget.placeholder),
                style: TextStyle(
                  color: Colors.transparent,
                ),
              ),
            ),
          ],
        ),
      );
    }
  </code></pre>