title: Flutter - What's the best practice to create a fixed AppBar during navigation
body: <p>In native android development, it is common to use <code>FragmentTransaction</code> to create a navigation animation, where the actionBar's position stays fixed (but actionBar's content changed), and the fragment beneath actionBar performs a transition animation (like slide in or out).</p>
  
  <p>To put it simple, the <code>AppBar</code> and the body performs different transition animation. In flutter, what is the best practice to create such animation?</p>
  
  <p>Currently I can think of a solution of using a navigation in <code>Scaffold.body</code> and using <code>Stream</code> + <code>StreamBuilder</code> to start <code>AppBar</code> redraw. Something like the following code.</p>
  
  <pre><code>Scaffold(
      appBar: StreamBuilder&lt;Int&gt;(
          stream: Bloc.of(context).currentFragmentId
          builder: //Some logic to decide which AppBar is appropriate
      ),
      body: Navigator(
          //Navigation between fragments
      ),
  )
  </code></pre>
  
  <p>But this is really weird. So is there a best practice to do this? Please let me know!</p>