AppLockManager constructor
AppLockManager({})
Throws ArgumentError when gracePeriod is negative or reason is
blank.
Implementation
AppLockManager({
required BiometricRepository biometrics,
this.gracePeriod = Duration.zero,
bool lockOnStart = false,
this.reason = 'Unlock to continue',
this.allowDeviceCredential = true,
DateTime Function()? now,
}) : _biometrics = biometrics,
_now = now ?? DateTime.now,
_locked = lockOnStart {
if (gracePeriod.isNegative) {
throw ArgumentError.value(gracePeriod, 'gracePeriod', 'Must be >= 0');
}
if (reason.trim().isEmpty) {
throw ArgumentError.value(reason, 'reason', 'Must not be blank');
}
}