createAppLockManager method

AppLockManager createAppLockManager({
  1. Duration gracePeriod = Duration.zero,
  2. bool lockOnStart = false,
  3. String reason = 'Unlock to continue',
  4. bool allowDeviceCredential = true,
})

Creates an AppLockManager that locks the app when it is backgrounded and unlocks it with biometrics / device credential.

Call start() on the result to begin observing the app lifecycle and dispose() when done.

Implementation

AppLockManager createAppLockManager({
  Duration gracePeriod = Duration.zero,
  bool lockOnStart = false,
  String reason = 'Unlock to continue',
  bool allowDeviceCredential = true,
}) => AppLockManager(
  biometrics: _biometricRepository,
  gracePeriod: gracePeriod,
  lockOnStart: lockOnStart,
  reason: reason,
  allowDeviceCredential: allowDeviceCredential,
);