title: Flutter Bloc: Why is a child BlocBuilder built with new state before parent BlocListener is notified?
body: <p>I have a root-level <code>BlocListener</code> that listens to my global <code>AuthBloc</code> for auth state changes and uses <code>Navigator</code> to return to the login page if a user signs out.</p>
  <p>A descendant <code>HomePage</code> widget also consumes that auth state under the assumption that <code>AuthBloc</code> is in an <code>AuthenticatedState</code> if it's being built. However, upon signing out, the child <code>HomePage</code> is built with the new <code>UnauthenticatedState</code> before the root <code>BlocListener</code> has had a chance to navigate back to login.</p>
  <pre class="lang-dart prettyprint-override"><code>class App extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
      // assume AuthBloc has already been provided
      return BlocBuilder&lt;AuthBloc, AuthState&gt;(
        listener: (context, state) {
          if (state is! AuthenticatedState) {
            Navigator.pushNamed(context, '/login');
            // ^--- I expect this to be called before HomePage gets UnauthenticatedState
          }
        },
        child: HomePage(),
      );
    }
  }
  
  
  class HomePage extends StatelessWidget {
    @override
    Widget build(BuildContext) {
      return BlocBuilder&lt;AuthBloc, AuthState&gt;(
        builder: (context, state) {
          // state == Unauthenticated after signing out  &lt;------
        }
      );
    }
  }
  </code></pre>
  <p>Is this expected behavior or should there be a guaranteed <code>parent-&gt;child</code> order of updates? What are the recommended patterns for dealing with this?</p>