eddyuan / privacy_screen

Privacy Screen Plugin for Flutter
MIT License
6 stars 11 forks source link

PrivacyGate class throwing error "Null check operator used on a null value" #2

Open timurbutt5053 opened 1 year ago

timurbutt5053 commented 1 year ago

this is my code:

`builder: (_, child) { return PrivacyGate( lockBuilder: (context) => const PrivacyLockPage(), navigatorKey: NavigationService.navigatorKey, onLifeCycleChanged: (appLifeCycle) { final user = ref.watch(currentLoggedUserProvider); if (user == null) return; if (user.userSettings?['local_auth'] != true) return;

              if (appLifeCycle == AppLifeCycle.iosWillResignActive ||
                  appLifeCycle == AppLifeCycle.androidOnPause ||
                  appLifeCycle == AppLifeCycle.androidOnDestroy) {
                PrivacyScreen.instance.resumeLock();
              }

              if ((appLifeCycle == AppLifeCycle.iosDidBecomeActive ||
                      appLifeCycle == AppLifeCycle.androidOnResume ||
                      appLifeCycle == AppLifeCycle.androidOnCreate) &&
                  !PrivacyScreen.instance.lockPaused) {
                PrivacyScreen.instance.lock();
              }
            },
            child: child);
      },`