mirror of
https://github.com/krille-chan/fluffychat
synced 2024-09-10 13:05:11 +00:00
fix: Disable applock
This commit is contained in:
parent
7a1ee371d4
commit
aee54a63f0
2 changed files with 6 additions and 23 deletions
|
@ -5,12 +5,10 @@ import 'package:flutter/material.dart';
|
|||
|
||||
import 'package:adaptive_dialog/adaptive_dialog.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:intl/intl.dart';
|
||||
import 'package:matrix/matrix.dart';
|
||||
|
||||
import 'package:fluffychat/config/setting_keys.dart';
|
||||
import 'package:fluffychat/utils/matrix_sdk_extensions/matrix_file_extension.dart';
|
||||
import 'package:fluffychat/widgets/app_lock.dart';
|
||||
import 'package:fluffychat/widgets/matrix.dart';
|
||||
|
@ -62,9 +60,7 @@ class SettingsSecurityController extends State<SettingsSecurity> {
|
|||
}
|
||||
|
||||
void setAppLockAction() async {
|
||||
final currentLock =
|
||||
await const FlutterSecureStorage().read(key: SettingKeys.appLockKey);
|
||||
if (currentLock?.isNotEmpty ?? false) {
|
||||
if (AppLock.of(context).isActive) {
|
||||
AppLock.of(context).showLockScreen();
|
||||
}
|
||||
final newLock = await showTextInputDialog(
|
||||
|
|
|
@ -1,12 +1,10 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:animations/animations.dart';
|
||||
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
|
||||
import 'package:matrix/matrix.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import 'package:fluffychat/config/setting_keys.dart';
|
||||
import 'package:fluffychat/config/themes.dart';
|
||||
import 'package:fluffychat/widgets/lock_screen.dart';
|
||||
|
||||
class AppLockWidget extends StatefulWidget {
|
||||
|
@ -105,22 +103,11 @@ class AppLock extends State<AppLockWidget> with WidgetsBindingObserver {
|
|||
@override
|
||||
Widget build(BuildContext context) => Provider<AppLock>(
|
||||
create: (_) => this,
|
||||
child: PageTransitionSwitcher(
|
||||
transitionBuilder: (
|
||||
Widget child,
|
||||
Animation<double> primaryAnimation,
|
||||
Animation<double> secondaryAnimation,
|
||||
) {
|
||||
return SharedAxisTransition(
|
||||
animation: primaryAnimation,
|
||||
secondaryAnimation: secondaryAnimation,
|
||||
transitionType: SharedAxisTransitionType.vertical,
|
||||
fillColor: Theme.of(context).scaffoldBackgroundColor,
|
||||
child: child,
|
||||
);
|
||||
},
|
||||
duration: FluffyThemes.animationDuration,
|
||||
child: _isLocked ? const LockScreen() : widget.child,
|
||||
child: Stack(
|
||||
children: [
|
||||
widget.child,
|
||||
if (isLocked) const LockScreen(),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue