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

View File

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