title: Flutter - Could not find the correct Provider<Provider> above this ChangeLocation Widget
body: <p>I'm using both BlocProvider &amp; ChangeNotifierProvider in my app. The flow of the app goes here:-</p>
  <ol>
  <li>first time user opens the app: InstructionPage() -&gt; WelcomePage() -&gt; HomePage() //getting error</li>
  <li>second time user opens the app: HomePage() //working fine</li>
  </ol>
  <p>I'm using sharedPreference to store the value of isInstructionPageLoaded.
  But navigating from WelcomePage() to HomePage() getting error <strong>Could not find the correct Provider above this ChangeLocation Widget</strong></p>
  <p>here is my code:-</p>
  <p>//main.dart</p>
  <pre><code>      void main() async {
        WidgetsFlutterBinding.ensureInitialized();
        await StorageUtil.getInstance();
        runApp(MyApp());
      }
  
  class MyApp extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
      return MaterialApp(
        theme: Theme.of(context).copyWith(primaryColor: kBgColorGreen),
        home: MultiBlocProvider(
            providers: [
              BlocProvider(
                  create: (context) =&gt;
                      RestaurantBloc()..add(RestaurantPageFetched())),
            ],
            child: MultiProvider(
              providers: [
                ChangeNotifierProvider(
                    create: (context) =&gt; LocationServiceProvider()),
              ],
              child: StorageUtil.getBoolValue(
                      SharedPrefsKeys.isInstructionPageLoaded)
                  ? HomePage()
                  : InstructionScreen(),
            )),
        routes: Routes.getRoutes(),
      );
    }
  }
  </code></pre>
  <p>//routes.dart</p>
  <pre><code>class Routes {
    static const String instruction = '/instruction';
    static const String welcome = '/welcome';
    static const String home = '/home';
    static const String change_location = '/change_location';
  
    static Map&lt;String, WidgetBuilder&gt; getRoutes() {
      return {
        Routes.instruction: (context) =&gt; InstructionScreen(),
        Routes.welcome: (context) =&gt; WelcomePage(),
        Routes.home: (context) =&gt; HomePage(),
        Routes.change_location: (context) =&gt; ChangeLocation(),
      };
    }
  }
  </code></pre>
  <p>//location_service.dart</p>
  <pre><code>class LocationServiceProvider extends ChangeNotifier {
    void toogleLocation(LocationService location) {
      location.isLocationUpdated = !location.isLocationUpdated;
      notifyListeners();
    }
  }
  
  class LocationService {
    bool isLocationUpdated = false;
  }
  </code></pre>
  <p>//welcome_page.dart -
  on button pressed calling below method</p>
  <pre><code> void _navigateToHomePage() async {
  Navigator.push(context, MaterialPageRoute(builder: (context) {
    return BlocProvider(
      create: (context) =&gt; RestaurantBloc()..add(RestaurantPageFetched()),
      child: ChangeNotifierProvider(create: (context) =&gt; LocationServiceProvider(),
      child: HomePage(),),
    );
  }));
  </code></pre>
  <p>}</p>
  <p>I have added BlocProvider in above method becoz before it was giving me error
  <strong>blocprovider.of() called with a context that does not contain a bloc navigating from other screen</strong> from navigating from WelcomePage() to HomePage().</p>
  <p>Thanks in advance!!!</p>