[mob][photos] Use better names

This commit is contained in:
ashilkn 2024-07-24 17:11:51 +05:30
parent 2f6530d6d6
commit 12fbc6c801
2 changed files with 10 additions and 10 deletions

View File

@ -49,7 +49,7 @@ class _LockScreenOptionsState extends State<LockScreenOptions> {
setState(() {
isPasswordEnabled = passwordEnabled;
isPinEnabled = pinEnabled;
hideAppContent = _lockscreenSetting.getShouldShowAppContent();
hideAppContent = _lockscreenSetting.getShouldHideAppContent();
});
}
@ -110,7 +110,7 @@ class _LockScreenOptionsState extends State<LockScreenOptions> {
await _configuration.setSystemLockScreen(!appLock);
await _lockscreenSetting.removePinAndPassword();
if (appLock == true) {
await _lockscreenSetting.setShowAppContent(false);
await _lockscreenSetting.setHideAppContent(false);
}
setState(() {
_initializeSettings();
@ -122,7 +122,7 @@ class _LockScreenOptionsState extends State<LockScreenOptions> {
setState(() {
hideAppContent = !hideAppContent;
});
await _lockscreenSetting.setShowAppContent(
await _lockscreenSetting.setHideAppContent(
hideAppContent,
);
}

View File

@ -17,7 +17,7 @@ class LockScreenSettings {
static const saltKey = "ls_salt";
static const keyInvalidAttempts = "ls_invalid_attempts";
static const lastInvalidAttemptTime = "ls_last_invalid_attempt_time";
static const keyShowAppContent = "ls_show_app_content";
static const keyHideAppContent = "ls_hide_app_content";
static const autoLockTime = "ls_auto_lock_time";
late FlutterSecureStorage _secureStorage;
late SharedPreferences _preferences;
@ -34,11 +34,11 @@ class LockScreenSettings {
_preferences = prefs;
///Workaround for privacyScreen not working when app is killed and opened.
await setShowAppContent(getShouldShowAppContent());
await setHideAppContent(getShouldHideAppContent());
}
Future<void> setShowAppContent(bool showContent) async {
!showContent
Future<void> setHideAppContent(bool hideContent) async {
!hideContent
? await PrivacyScreen.instance.disable()
: await PrivacyScreen.instance.enable(
iosOptions: const PrivacyIosOptions(
@ -50,11 +50,11 @@ class LockScreenSettings {
),
blurEffect: PrivacyBlurEffect.extraLight,
);
await _preferences.setBool(keyShowAppContent, showContent);
await _preferences.setBool(keyHideAppContent, hideContent);
}
bool getShouldShowAppContent() {
return _preferences.getBool(keyShowAppContent) ?? false;
bool getShouldHideAppContent() {
return _preferences.getBool(keyHideAppContent) ?? false;
}
Future<void> setAutoLockTime(Duration duration) async {