title: How to vertically center text/title in Flutter using SliverAppBar?
body: <p>I am trying to set up a SliverAppBar in a CustomScrollView using Flutter, and can't get to vertically center the title.</p>
  
  <p>I already tried <a href="https://stackoverflow.com/a/51882748/9616735">this solution</a> (and this SO question is exactly what I want to do) but fortunately, it didn't work for me.</p>
  
  <p>Here is my build method:</p>
  
  <pre class="lang-java prettyprint-override"><code>@override
  Widget build(BuildContext context) {
    return Scaffold(
      body: CustomScrollView(
        slivers: &lt;Widget&gt;[
          SliverAppBar(
            pinned: true,
            expandedHeight: 200,
            //backgroundColor: Colors.transparent,
            flexibleSpace: FlexibleSpaceBar(
              titlePadding: EdgeInsets.zero,
              centerTitle: true,
              title: Column(
                crossAxisAlignment: CrossAxisAlignment.stretch,
                mainAxisAlignment: MainAxisAlignment.center,
                mainAxisSize: MainAxisSize.min,
                children: &lt;Widget&gt;[
                  Text("Should be centered", textAlign: TextAlign.center),
                ],
              ),
              background: Image.asset("assets/earth.jpg", fit: BoxFit.cover),
            ),
            actions: &lt;Widget&gt;[
              IconButton(
                icon: const Icon(Icons.menu),
                tooltip: "Menu",
                onPressed: () {
                  // onPressed handler
                },
              ),
            ],
          ),
          SliverFixedExtentList(
            itemExtent: 50,
            delegate: SliverChildBuilderDelegate(
              (BuildContext context, int index) {
                return Container(
                  alignment: Alignment.center,
                  color: Colors.green,
                  child: Text("Index n°$index"),
                );
              },
            ),
          )
        ],
      ),
    );
  }
  </code></pre>
  
  <p>I really don't understand what is wrong and why it isn't centered. I observed that the column is way too big when setting mainAxisSize to mainAxisSize.max.</p>
  
  <p>Any idea?</p>
  
  <p>Thanks in advance!</p>