mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-12-24 14:32:37 +01:00
fix: App lock
This commit is contained in:
parent
4d9ed521f5
commit
8d6642c07d
@ -13,7 +13,9 @@ import 'package:fluffychat/utils/sentry_controller.dart';
|
||||
import 'package:flushbar/flushbar.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_app_lock/flutter_app_lock.dart';
|
||||
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
||||
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
|
||||
import 'package:future_loading_dialog/future_loading_dialog.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:universal_html/prefer_universal/html.dart' as html;
|
||||
@ -298,6 +300,17 @@ class MatrixState extends State<Matrix> {
|
||||
LoginState loginState;
|
||||
|
||||
void initMatrix() {
|
||||
// Display the app lock
|
||||
if (PlatformInfos.isMobile) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
FlutterSecureStorage().read(key: SettingKeys.appLockKey).then((lock) {
|
||||
if (lock?.isNotEmpty ?? false) {
|
||||
AppLock.of(context).enable();
|
||||
AppLock.of(context).showLockScreen();
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
clientName =
|
||||
'${AppConfig.applicationName} ${kIsWeb ? 'Web' : Platform.operatingSystem}';
|
||||
final Set verificationMethods = <KeyVerificationMethod>{
|
||||
|
@ -30,6 +30,7 @@ void main() async {
|
||||
? AppLock(
|
||||
builder: (args) => App(),
|
||||
lockScreen: LockScreen(),
|
||||
enabled: false,
|
||||
)
|
||||
: App()),
|
||||
SentryController.captureException,
|
||||
|
Loading…
Reference in New Issue
Block a user