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:adaptive_dialog/adaptive_dialog.dart';
|
||||||
import 'package:flutter_gen/gen_l10n/l10n.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:future_loading_dialog/future_loading_dialog.dart';
|
||||||
import 'package:intl/intl.dart';
|
import 'package:intl/intl.dart';
|
||||||
import 'package:matrix/matrix.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/utils/matrix_sdk_extensions/matrix_file_extension.dart';
|
||||||
import 'package:fluffychat/widgets/app_lock.dart';
|
import 'package:fluffychat/widgets/app_lock.dart';
|
||||||
import 'package:fluffychat/widgets/matrix.dart';
|
import 'package:fluffychat/widgets/matrix.dart';
|
||||||
|
@ -62,9 +60,7 @@ class SettingsSecurityController extends State<SettingsSecurity> {
|
||||||
}
|
}
|
||||||
|
|
||||||
void setAppLockAction() async {
|
void setAppLockAction() async {
|
||||||
final currentLock =
|
if (AppLock.of(context).isActive) {
|
||||||
await const FlutterSecureStorage().read(key: SettingKeys.appLockKey);
|
|
||||||
if (currentLock?.isNotEmpty ?? false) {
|
|
||||||
AppLock.of(context).showLockScreen();
|
AppLock.of(context).showLockScreen();
|
||||||
}
|
}
|
||||||
final newLock = await showTextInputDialog(
|
final newLock = await showTextInputDialog(
|
||||||
|
|
|
@ -1,12 +1,10 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import 'package:animations/animations.dart';
|
|
||||||
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
|
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
|
||||||
import 'package:matrix/matrix.dart';
|
import 'package:matrix/matrix.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
import 'package:fluffychat/config/setting_keys.dart';
|
import 'package:fluffychat/config/setting_keys.dart';
|
||||||
import 'package:fluffychat/config/themes.dart';
|
|
||||||
import 'package:fluffychat/widgets/lock_screen.dart';
|
import 'package:fluffychat/widgets/lock_screen.dart';
|
||||||
|
|
||||||
class AppLockWidget extends StatefulWidget {
|
class AppLockWidget extends StatefulWidget {
|
||||||
|
@ -105,22 +103,11 @@ class AppLock extends State<AppLockWidget> with WidgetsBindingObserver {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) => Provider<AppLock>(
|
Widget build(BuildContext context) => Provider<AppLock>(
|
||||||
create: (_) => this,
|
create: (_) => this,
|
||||||
child: PageTransitionSwitcher(
|
child: Stack(
|
||||||
transitionBuilder: (
|
children: [
|
||||||
Widget child,
|
widget.child,
|
||||||
Animation<double> primaryAnimation,
|
if (isLocked) const LockScreen(),
|
||||||
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,
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue