title: Flutter Application Bloc listener not receiving state updates
body: <p>I'm using flutter Bloc to navigate the user towards either the login page or home screen depending on wether they are authenticated or not. However, after the initial state change, the listener doesn't trigger when I change my authentication state.</p>
  <p>Listener:</p>
  <pre><code>Widget build(BuildContext context) {
    return BlocListener&lt;AuthenticationBloc, AuthenticationState&gt;(
      listener: (context, state) {
        // Listener never gets called on statechange after the initial app startup
  
        // navigation based on authentication 
        }
      },
      child: SplashPage(),
    );
  }
  </code></pre>
  <p>The provider gets initialized in the parent widget:</p>
  <pre><code>AuthenticationRepository authRepo = AuthenticationRepository();
  
  Widget build(BuildContext context) {
    return MultiBlocProvider(
      providers: [
        BlocProvider&lt;AuthenticationBloc&gt;(
          create: (BuildContext context) =&gt;
              AuthenticationBloc(authenticationRepository: authRepo),
        ),
        /*
           Other Providers
        */
      ],
      child: MaterialApp(
        title: 'myApp',
        home: StartUpPage(),
      ),
    );
  </code></pre>
  <p>When the user logs in mapEventState gets called in the AuthenticationBloc:</p>
  <pre><code>class AuthenticationBloc
      extends Bloc&lt;AuthenticationEvent, AuthenticationState&gt; {
    AuthenticationBloc({
      @required AuthenticationRepository authenticationRepository,
    })  : assert(authenticationRepository != null),
          _authenticationRepository = authenticationRepository,
          super(const AuthenticationState.unknown()) {
      _userSubscription = _authenticationRepository.userStream.listen(
        (user) =&gt; add(AuthenticationUserChanged(user)),
      );
    }
  
    final AuthenticationRepository _authenticationRepository;
    StreamSubscription&lt;User&gt; _userSubscription;
  
    @override
    Stream&lt;AuthenticationState&gt; mapEventToState(
      AuthenticationEvent event,
    ) async* {
      if (event is AuthenticationUserChanged) {
        yield _mapAuthenticationUserChangedToState(event);
      } else if (event is AuthenticationLogoutRequested) {
        unawaited(_authenticationRepository.logOut());
      }
    }
  
    @override
    Future&lt;void&gt; close() {
      _userSubscription?.cancel();
      return super.close();
    }
  
    AuthenticationState _mapAuthenticationUserChangedToState(
      AuthenticationUserChanged event,
    ) =&gt;
        event.user != User.empty
            ? AuthenticationState.authenticated(event.user)
            : const AuthenticationState.unauthenticated();
  }
  </code></pre>
  <p>I'd expect the listener to trigger when the user logs in and the AuthenticationState changes. If anyone knows what I'm doing wrong or if I'm missing something I'd love to hear it.</p>
  <p><strong>EDITED 08-02-2021:</strong></p>
  <p>I've checked again if the state changes after login using a simple button. With this I can confirm that the state does change and holds the correct user data and authentication status. Another thing I confirmed is that a BlocBuilder that is using a BlocBuilder&lt;AuthenticationBloc, AuthenticationState&gt; <strong>IS</strong> updating correctly when a user logs in.</p>
  <p><strong>EDITED 10-02-2021:</strong></p>
  <p>Entire Authentication state:</p>
  <pre><code>enum AuthenticationStatus { authenticated, unauthenticated, unknown }
  
  class AuthenticationState extends Equatable {
    const AuthenticationState._({
      this.status = AuthenticationStatus.unknown,
      this.user = User.empty,
    });
  
    const AuthenticationState.unknown() : this._();
  
    const AuthenticationState.authenticated(User user)
        : this._(status: AuthenticationStatus.authenticated, user: user);
  
    const AuthenticationState.unauthenticated()
        : this._(status: AuthenticationStatus.unauthenticated, user: User.empty);
  
    final AuthenticationStatus status;
    final User user;
  
    @override
    List&lt;Object&gt; get props =&gt; [status, user];
  }
  </code></pre>
  <p><strong>EDITED 12-02-2021:</strong></p>
  <p>removed non-relevant code</p>
  <p><strong>EDITED 15-02-2021:</strong></p>
  <p>Added entire Authentication BloC</p>