title: I want auth state to change true if user id is in secure storage in flutter
body: <p>I want auth state to change true if user id is in secure storage. and then remove splash. I use Flutter_Secure_Storage and flutter_native_splash, Beamer.
  I want to just one time check if user_id in secure storage and then change auth state.</p>
  <p>it show below error code</p>
  <blockquote>
  <p>Error: Could not find the correct Provider
  above this MyApp Widget</p>
  </blockquote>
  <pre><code>void main() {
    WidgetsBinding widgetsBinding = WidgetsFlutterBinding.ensureInitialized();
    FlutterNativeSplash.preserve(widgetsBinding: widgetsBinding);
  
    runApp(const MyApp());
  }
  
  
  class MyApp extends StatefulWidget {
    const MyApp({Key? key}) : super(key: key);
  
    @override
    State&lt;MyApp&gt; createState() =&gt; _MyAppState();
  }
  
  class _MyAppState extends State&lt;MyApp&gt; {
    late FlutterSecureStorage _storage;
  
    @override
    void initState(){
      _storage = const FlutterSecureStorage();
      getUserId();
      FlutterNativeSplash.remove();
      super.initState();
    }
  
    Future getUserId() async {
      final loginNotifier = Provider.of&lt;AuthenticationNotifier&gt;(context, listen: false);
      final userId = await _storage.read(key: &quot;userId&quot;);
      if (userId != null) {
        loginNotifier.setUserAuth(true);
      }
    }
  
    @override
    Widget build(BuildContext context) {
      return ScreenUtilInit(
        designSize: const Size(375, 812),
        builder: (BuildContext context, Widget? child) {
          return MultiProvider(
            providers: [
              ChangeNotifierProvider&lt;AuthenticationNotifier&gt;.value(
                  value: authNotifier),
            ],
            child: MaterialApp.router(
              routeInformationParser: BeamerParser(),
              routerDelegate: _routerDelegate,
            ),
          );
        },
      );
    }
  }
  
  final _routerDelegate = BeamerDelegate(
    updateListenable: authNotifier,
    guards: [
      BeamGuard(
        beamToNamed: (origin, target) =&gt; '/$locationAuth',
        pathPatterns: [
          ...HomeLocation().pathPatterns,
        ],
        check: (context, location) {
          return Provider.of&lt;AuthenticationNotifier&gt;(context, listen: false).isAuthenticated;
        },
      ),
      BeamGuard(
        beamToNamed: (origin, target) =&gt; '/',
        pathPatterns: ['/$locationAuth'],
        check: (context, location) {
          return !Provider.of&lt;AuthenticationNotifier&gt;(context, listen: false)
              .isAuthenticated;
        },
      )
    ],
    locationBuilder: BeamerLocationBuilder(beamLocations: [
      HomeLocation(),
      AuthLocation(),
    ]),
  );
  </code></pre>