title: Calculate height of Text widget at build
body: <p>I'm trying to add padding under a <code>SliverFixedExtentList</code> to fill the screen by using a <code>SliverPadding</code> and add a <code>Text.rich</code> widget at the bottom of the screen. Calculating the height of the list was rather easy because I'm setting the extent. But I should also keep the height of the <code>Text.rich</code> widget in mind.</p>
  
  <p>I'm uncertain about how to calculate the height of the <code>Text.rich</code> widget at build time, is this possible? If not, what would be a better approach?</p>
  
  <p>I've been using the following code:</p>
  
  <pre><code>  Widget build(BuildContext context) {
      double maxNonScrollableListSize = (MediaQuery.of(context).size.height - listPadding.bottom - listPadding.top - bottomFooterPadding.bottom - fontSize - 2);
      double totalChildHeight = childCount * itemExtent;
      double footerPadding = maxNonScrollableListSize &gt; totalChildHeight ? maxNonScrollableListSize - totalChildHeight : 5.0;
      return new Scaffold(
        body: new Container(
          color: new Color.fromRGBO(50, 120, 176, 1.0),
          child: new CustomScrollView(
            slivers: &lt;Widget&gt;[
              new SliverPadding(
                padding: listPadding,
                sliver: new SliverFixedExtentList(
                  itemExtent: itemExtent,
                  delegate: new SliverChildBuilderDelegate(
                    (BuildContext context, int index) {
                      return new Card(
                        child: new Container(
                          child: new Center(child: new Text("Card $index")),
                        ),
                      );
                    },
                    childCount: childCount,
                  ),
                ),
              ),
              new SliverPadding(
                padding: new EdgeInsets.only(bottom: footerPadding),
              ),
              new SliverToBoxAdapter(
                child: new Column(
                  mainAxisSize: MainAxisSize.max,
                  mainAxisAlignment: MainAxisAlignment.end,
                  children: &lt;Widget&gt;[
                    new Container(child: new Text("ok", style: new TextStyle(fontSize: fontSize),))
                  ],
                ),
              ),
              new SliverPadding(
                padding: bottomFooterPadding,
              ),
            ],
          )
        ),
      );
    }
  </code></pre>