mirror of
https://github.com/ente-io/ente.git
synced 2025-08-12 17:20:37 +00:00
[mob][auth] Code clean up
This commit is contained in:
parent
878d22fd4a
commit
2101817b23
@ -2,8 +2,6 @@ import "dart:convert";
|
|||||||
import "dart:typed_data";
|
import "dart:typed_data";
|
||||||
|
|
||||||
import "package:ente_crypto_dart/ente_crypto_dart.dart";
|
import "package:ente_crypto_dart/ente_crypto_dart.dart";
|
||||||
import "package:flutter/material.dart";
|
|
||||||
import "package:flutter/scheduler.dart";
|
|
||||||
import "package:flutter_secure_storage/flutter_secure_storage.dart";
|
import "package:flutter_secure_storage/flutter_secure_storage.dart";
|
||||||
import "package:privacy_screen/privacy_screen.dart";
|
import "package:privacy_screen/privacy_screen.dart";
|
||||||
import "package:shared_preferences/shared_preferences.dart";
|
import "package:shared_preferences/shared_preferences.dart";
|
||||||
@ -41,9 +39,6 @@ class LockScreenSettings {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<void> setHideAppContent(bool hideContent) async {
|
Future<void> setHideAppContent(bool hideContent) async {
|
||||||
final brightness =
|
|
||||||
SchedulerBinding.instance.platformDispatcher.platformBrightness;
|
|
||||||
bool isInDarkMode = brightness == Brightness.dark;
|
|
||||||
!hideContent
|
!hideContent
|
||||||
? PrivacyScreen.instance.disable()
|
? PrivacyScreen.instance.disable()
|
||||||
: await PrivacyScreen.instance.enable(
|
: await PrivacyScreen.instance.enable(
|
||||||
@ -53,10 +48,7 @@ class LockScreenSettings {
|
|||||||
androidOptions: const PrivacyAndroidOptions(
|
androidOptions: const PrivacyAndroidOptions(
|
||||||
enableSecure: true,
|
enableSecure: true,
|
||||||
),
|
),
|
||||||
backgroundColor: isInDarkMode ? Colors.black : Colors.white,
|
blurEffect: PrivacyBlurEffect.extraLight,
|
||||||
blurEffect: isInDarkMode
|
|
||||||
? PrivacyBlurEffect.dark
|
|
||||||
: PrivacyBlurEffect.extraLight,
|
|
||||||
);
|
);
|
||||||
await _preferences.setBool(keyHideAppContent, hideContent);
|
await _preferences.setBool(keyHideAppContent, hideContent);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user