title: How to update screen A when navigating back from screen B with bloc flutter
body: <p>I have a screen(A) which use 'AccountFetched' state to load list of data from database:</p>
  <pre><code>return BlocProvider&lt;AccountBloc&gt;(
        create: (context) {
          return _accountBloc..add(FetchAccountEvent());
        },
        child: BlocBuilder&lt;AccountBloc, AccountState&gt;(
          builder: (context, state) {
            if (state is AccountFetched) {
              accounts = state.accounts;
            }
  </code></pre>
  <p>And in my second screen(B) I call AddAccountEvent to add data to database and navigate back to screen(A) which is the parent screen.</p>
  <pre><code>onPressed: () {
     BlocProvider.of&lt;AccountBloc&gt;(context)
       ..add(AddAccountEvent(account: account));
     Navigator.of(context).pop();
  }
  </code></pre>
  <p>But when I navigate back to screen A, the list of data is not updated.
  Should I refresh the screen(A) manually or how can I update the state of bloc?</p>
  <p>This is my bloc class:</p>
  <pre><code>class AccountBloc extends Bloc&lt;AccountEvent, AccountState&gt; {
    AccountBloc() : super(AccountInitial());
  
    @override
    Stream&lt;AccountState&gt; mapEventToState(AccountEvent event) async* {
      if (event is FetchAccountEvent) yield* _fetchAccountEvent(event, state);
      if (event is AddAccountEvent) yield* _addAccountEvent(event, state);
    }
  
    Stream&lt;AccountState&gt; _fetchAccountEvent(
        FetchAccountEvent event, AccountState state) async* {
      yield FetchingAccount();
      final dbAccount = await DBAccountRepository.instance;
      List&lt;Account&gt; accounts = await dbAccount.accounts();
      yield AccountFetched(accounts: accounts);
    }
  
    Stream&lt;AccountState&gt; _addAccountEvent(
        AddAccountEvent event, AccountState state) async* {
      yield AddingAccount();
      final dbAccount = await DBAccountRepository.instance;
      final insertedId = await dbAccount.insertAccount(event.account);
      yield AccountAdded(insertedId: insertedId);
    }
  }
  </code></pre>