title: BlocProvider.of() called with a context that does not contain a Bloc of type TrackingBloc
body: <p>I'm trying to provide a <code>TrackingBloc</code> to <code>MapScreen</code> but when sending an event from <code>onPressed</code> I get the error <code>BlocProvider.of() called with a context that does not contain a Bloc of type TrackingBloc.</code> 
  <code>MapScreen</code> also uses a <code>MapBloc</code> provided from <code>main()</code>, but for <code>TrackingBloc</code> I want to make it local, not to clutter <code>MultiBlocProvider</code>in <code>main()</code>. 
  I tried:</p>
  
  <ol>
  <li>To use the <code>bloc:</code> parameter in the <code>BlocListener&lt;TrackingBloc, TrackingState&gt;</code>, as I've been told that it just provides the bloc as a <code>BlocProvider</code> would(<a href="https://github.com/felangel/bloc/issues/930#issuecomment-593790702" rel="nofollow noreferrer">https://github.com/felangel/bloc/issues/930#issuecomment-593790702</a>) but it didn't work.</li>
  <li>Then I tried making <code>MultiBlocLister</code> a child of a <code>MultiBlocProvider</code> and set <code>TrackingBloc</code> there, but still get the message.</li>
  <li>Set <code>TrackingBloc</code>in the <code>MultiBlocProvider</code> in `main() and worked as expected.</li>
  </ol>
  
  <p>Why 1 and 2 don't provide <code>TrackingBloc</code>to the tree? 
  Many thanks for your help.</p>
  
  <p>MapScreen:</p>
  
  <pre><code>class MapScreen extends StatefulWidget {
    final String name;
    final MapRepository _mapRepository;
  
    MapScreen(
        {Key key, @required this.name, @required MapRepository mapRepository})
        : assert(mapRepository != null),
          _mapRepository = mapRepository,
          super(key: key);
  
    @override
    _MapScreenState createState() =&gt; _MapScreenState();
  }
  
  class _MapScreenState extends State&lt;MapScreen&gt; {
    List&lt;Marker&gt; alerts;
    LatLng userLocation;
  
    MapController _mapController = MapController();
  
    @override
    Widget build(BuildContext context) {
      return MultiBlocProvider(
        providers: [
          BlocProvider&lt;TrackingBloc&gt;(create: (context) {
            return TrackingBloc();
          }),
        ],
        child: MultiBlocListener(
          listeners: [
            BlocListener&lt;MapBloc, MapState&gt;(
                listener: (BuildContext context, MapState state) {
              if (state is LocationStream) {
                setState(() {
                  userLocation = (state).location;
  //              print(
  //                  ' @@@@ MapBloc actual user location from stream  is : $userLocation');
                });
              }
              if (state is MapCenter) {
                userLocation = (state).location;
  //            print(' @@@@ MapBloc initial center location is : $userLocation');
                _mapController.move(userLocation, 16);
              }
            }),
            BlocListener&lt;TrackingBloc, TrackingState&gt;(
  //              bloc: TrackingBloc(),
                listener: (BuildContext context, TrackingState state) {
              if (state is TrackedRoute) {
                List&lt;Position&gt; route = (state).trackedRoute;
                print(route);
              }
            }),
          ],
          child: Scaffold(
  </code></pre>
  
  <p>main():</p>
  
  <pre><code>  runApp(
      MultiBlocProvider(
        providers: [
          BlocProvider&lt;AuthenticationBloc&gt;(
            create: (context) {
              return AuthenticationBloc(
                userRepository: UserRepository(),
              )..add(AppStarted());
            },
          ),
          BlocProvider&lt;MapBloc&gt;(create: (context) {
            return MapBloc(
              mapRepository: mapRepository,
            )
              ..add(GetLocationStream())
              ..add(GetLocation());
          }),
          BlocProvider&lt;TrackingBloc&gt;(create: (context) {
            return TrackingBloc();
          }),
  //        BlocProvider&lt;AlertBloc&gt;(create: (context) {
  //          return AlertBloc(
  //            alertRepository: alertRepository,
  //          )..add(LoadAlerts());
  //        }),
        ],
        child:
  </code></pre>