didUnlock method

void didUnlock([
  1. Object? launchArg
])

Causes AppLock to either pop the lockScreen (or preferably the Widget returned from lockScreenBuilder) if the app is already running or instantiates widget returned from the builder method if the app is cold launched.

launchArg is an optional argument which will get passed to the builder method when built. Use this when you want to inject objects created from the lockScreen (or preferably the Widget returned from lockScreenBuilder) in to the rest of your app so you can better guarantee that some objects, services or databases are already instantiated before using them.

Implementation

void didUnlock([Object? launchArg]) {
  if (_didUnlockForAppLaunch) {
    _didUnlockOnAppPaused();
  } else {
    _didUnlockOnAppLaunch(launchArg);
  }

  _didUnlockCompleter?.complete();
}