title: Flutter BLoC listening to other blocs
body: <p>I am fairly new to Flutter and very new to using BLoc.</p>
  <p>I have a situation where I need to have a single BLoc respond to state changes in two other BLoc's.</p>
  <p>The BLoC's are set up as follows:</p>
  <pre><code>    body: MultiBlocProvider(
        providers: [
          BlocProvider(
            create: (context) =&gt; NeighborBloc(repository: pcRepository),
          ),
          BlocProvider(
            create: (context) =&gt; FamilyBloc(repository: pcRepository),
          ),
          BlocProvider(
            create: (context) =&gt; RegionBloc(
                repository: repository,
                neighborBloc: BlocProvider.of&lt;NeighborBloc&gt;(context),
                familyBloc: BlocProvider.of&lt;FamilyBloc&gt;(context)),
          ),
        ],
  </code></pre>
  <p>The constructor for RegionBloc is:</p>
  <pre><code>RegionBloc(
     {@required this.neighborBloc,
     @required this.familyBloc,
     @required this.repository})
     : assert(repository != null),
       super(RegionEmpty()) {
   print(&quot;NB: &quot; + neighborBloc .toString());
   print(&quot;FB: &quot; + familyBloc .toString());
   _neighborBlocSubscription = neighborBloc.listen((neighborState) {
     if (neighborState is NeighborSelected) {
       Postcode postcode = (neighborState as NeighborSelected).postcode;
       add(NeighborSelected(postcode));
     }
   });
   _familyBlocSubscription = familyBloc.listen((familyState) {
     if (familyState is FamilySelected) {
       Postcode postcode = (familyState as FamilySelected).postcode;
       add(FamilySelected(postcode));
     }
   });
  }
  </code></pre>
  <p>The result of the two print statements are:
  NB: Instance of 'NeighborBloc'
  FB: Instance of 'FamilyBloc'</p>
  <p>I have a BlocObserver setup and I get the transitions for the neighborState</p>
  <pre><code>onTransition  NeighborBloc, transition: Transition { currentState: NeighborLoading, event: 
  SelectNeighbor, nextState: NeighborSelected }
  onChange NeighborBloc, Change { currentState: NeighborLoading, nextState:      
      NeighborSelected }
  </code></pre>
  <p>The RegionBloc-&gt;NeighborSelection is never added.  The BlocBuilder for
  the RegionBloc is:</p>
  <pre><code>return BlocBuilder&lt;RegionBloc, RegionState&gt;(builder: (context, state) {
    if (state is RegionEmpty) {
      return Text('Empty Region');
    }
    if (state is RegionLoaded) {
      return Text('RegionsLoaded');
    }
    if (state is NeighborSelected) {
      return Text('NeighborSelected');
    }
    if (state is FamilySelected) {
      return Text('FamilySelected');
    }
    //return Center(
    //  child: CircularProgressIndicator(),
    //);
    setPolygon();
    return Container(
  </code></pre>
  <p>I have read this link and I think I am doing it:
  <a href="https://stackoverflow.com/questions/59137180/flutter-listen-bloc-state-from-other-bloc">Flutter listen Bloc state from Other Bloc</a></p>
  <p>I can't tell what I am not doing or doing wrong.</p>