fix: Flutter warnings because of applock animation
This commit is contained in:
parent
823810ec19
commit
ea75e98c37
2 changed files with 18 additions and 7 deletions
|
|
@ -322,7 +322,8 @@ class BackgroundPush {
|
|||
?.content
|
||||
.tryGet<String>('type') ==
|
||||
ClientStoriesExtension.storiesRoomType;
|
||||
FluffyChatApp.router.go('/${isStory ? 'rooms/stories' : 'rooms'}/$roomId');
|
||||
FluffyChatApp.router
|
||||
.go('/${isStory ? 'rooms/stories' : 'rooms'}/$roomId');
|
||||
} catch (e, s) {
|
||||
Logs().e('[Push] Failed to open room', e, s);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
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';
|
||||
|
|
@ -61,8 +62,6 @@ class AppLock extends State<AppLockWidget> with WidgetsBindingObserver {
|
|||
}
|
||||
|
||||
bool get isLocked => _isLocked;
|
||||
CrossFadeState get _crossFadeState =>
|
||||
_isLocked ? CrossFadeState.showSecond : CrossFadeState.showFirst;
|
||||
|
||||
Future<void> changePincode(String? pincode) async {
|
||||
await const FlutterSecureStorage().write(
|
||||
|
|
@ -95,11 +94,22 @@ class AppLock extends State<AppLockWidget> with WidgetsBindingObserver {
|
|||
@override
|
||||
Widget build(BuildContext context) => Provider<AppLock>(
|
||||
create: (_) => this,
|
||||
child: AnimatedCrossFade(
|
||||
firstChild: widget.child,
|
||||
secondChild: const LockScreen(),
|
||||
crossFadeState: _crossFadeState,
|
||||
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,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue