title: Get the Height of a Widget and pass it to expandedHeight
body: <p>I want to place an image as the background of my <code>AppBar</code> as in here:</p>
  
  <p><a href="https://i.stack.imgur.com/PAn2G.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PAn2G.png" alt="enter image description here"></a></p>
  
  <p>The only way I know is by using the <code>flexibleSpace</code> of a <code>SliverAppBar</code> (inside a <code>CustomScrollView</code>) as a normal <code>AppBar</code> won't change it's size to accommodate the image.</p>
  
  <p>The problem is that a <code>SliverAppBar</code> needs a <code>expandedHeight</code> that's hardcoded and each of my screens will show a different image that has a different height, so I need to programmatically get the height and pass it to <code>expandedHeight</code>.</p>
  
  <p>Is it possible to get the future height of an image, so that the image will not distort and fill the width of the screen, so I can pass it to <code>expandedHeight</code>?</p>