fix: comments were kinda ass
This commit is contained in:
@@ -40,7 +40,7 @@ class PinLockViewModel extends ChangeNotifier {
|
||||
await load();
|
||||
}
|
||||
|
||||
/// Checks whether a PIN has already been configured on this device.
|
||||
// Checks whether a pin has already been configured on this device.
|
||||
Future<void> load() async {
|
||||
if (_isLoading) return;
|
||||
|
||||
@@ -66,9 +66,6 @@ class PinLockViewModel extends ChangeNotifier {
|
||||
}
|
||||
}
|
||||
|
||||
/// Creates a new PIN (first-time setup, or after disabling an old one).
|
||||
/// Unlocks the app immediately on success, since the person just proved
|
||||
/// they know it by typing it.
|
||||
Future<bool> setPin(String pin) async {
|
||||
_errorMessage = null;
|
||||
|
||||
@@ -94,7 +91,6 @@ class PinLockViewModel extends ChangeNotifier {
|
||||
}
|
||||
}
|
||||
|
||||
/// Checks an entered PIN against the stored one, unlocking on match.
|
||||
Future<bool> verify(String pin) async {
|
||||
_errorMessage = null;
|
||||
|
||||
@@ -118,7 +114,6 @@ class PinLockViewModel extends ChangeNotifier {
|
||||
}
|
||||
}
|
||||
|
||||
/// Replaces the current PIN. Requires the current PIN to match first.
|
||||
Future<bool> changePin({
|
||||
required String currentPin,
|
||||
required String newPin,
|
||||
@@ -134,7 +129,6 @@ class PinLockViewModel extends ChangeNotifier {
|
||||
return setPin(newPin);
|
||||
}
|
||||
|
||||
/// Removes the PIN entirely. Requires the current PIN to confirm.
|
||||
Future<bool> disablePin(String currentPin) async {
|
||||
final matches = await pinLockService.verifyPin(currentPin);
|
||||
|
||||
@@ -158,9 +152,6 @@ class PinLockViewModel extends ChangeNotifier {
|
||||
return true;
|
||||
}
|
||||
|
||||
/// Re-locks the app. Call this on app backgrounding (e.g. from a
|
||||
/// WidgetsBindingObserver on AppLifecycleState.paused) if you want the
|
||||
/// PIN required again after the app is put away, not just on cold start.
|
||||
void lock() {
|
||||
if (!_isUnlocked) return;
|
||||
|
||||
|
||||
@@ -103,8 +103,6 @@ class SettingsViewModel extends ChangeNotifier {
|
||||
}
|
||||
}
|
||||
|
||||
/// Just flips the preference flag. Caller is responsible for having
|
||||
/// already set/verified the actual PIN via PinLockViewModel first.
|
||||
Future<void> updatePinRequired(bool value) =>
|
||||
_save(_settings.copyWith(pinRequired: value));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user