title: How to change AppBar height dynamically during runtime based on the AppBar content in Flutter?
body: <p>I'm trying to implement a <a href="https://flutterawesome.com/a-textfield-flutter-package-with-tagging-functionality/" rel="nofollow noreferrer">flutter_tagging</a> inside the <code>AppBar</code>. I managed to add the tagged <code>TextField</code> inside the <code>AppBar</code> and to resize the <code>AppBar</code> using <code>PreferredSize</code> widget using the following code:</p>
  <pre><code>return PreferredSize(
      preferredSize: Size.fromHeight(110),
      child: AppBar(
        backgroundColor: HexColor('171551'),
        leading: const BackButton(),
        flexibleSpace: Padding(
          padding: const EdgeInsets.only(top: 48.0, left: 10, right: 10),
          child: buildTaggedSearch(),
        ),
        title: Container(),
        actions: _buildActions(),
      ),
    );
  </code></pre>
  <p>And this is the result:</p>
  <p><a href="https://i.stack.imgur.com/bKEoc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bKEoc.png" alt="enter image description here" /></a></p>
  <p>The problem I can't manage to solve is what happens when user enter too many tags and the tags go to the second line, this is what happens:</p>
  <p><a href="https://i.stack.imgur.com/mu98w.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mu98w.png" alt="enter image description here" /></a></p>
  <p>I'm still new to Flutter and maybe I missing something, but how would I solve this issue and make the <code>AppBar</code> resize based on the content of the tags. I went over most of the questions here which talk about the AppBar resize, all of them use the <code>PreferredSize</code> widget which I use here. So I wonder if there is another option?</p>