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
|
?.content
|
||||||
.tryGet<String>('type') ==
|
.tryGet<String>('type') ==
|
||||||
ClientStoriesExtension.storiesRoomType;
|
ClientStoriesExtension.storiesRoomType;
|
||||||
FluffyChatApp.router.go('/${isStory ? 'rooms/stories' : 'rooms'}/$roomId');
|
FluffyChatApp.router
|
||||||
|
.go('/${isStory ? 'rooms/stories' : 'rooms'}/$roomId');
|
||||||
} catch (e, s) {
|
} catch (e, s) {
|
||||||
Logs().e('[Push] Failed to open room', e, s);
|
Logs().e('[Push] Failed to open room', e, s);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
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';
|
||||||
|
|
@ -61,8 +62,6 @@ class AppLock extends State<AppLockWidget> with WidgetsBindingObserver {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool get isLocked => _isLocked;
|
bool get isLocked => _isLocked;
|
||||||
CrossFadeState get _crossFadeState =>
|
|
||||||
_isLocked ? CrossFadeState.showSecond : CrossFadeState.showFirst;
|
|
||||||
|
|
||||||
Future<void> changePincode(String? pincode) async {
|
Future<void> changePincode(String? pincode) async {
|
||||||
await const FlutterSecureStorage().write(
|
await const FlutterSecureStorage().write(
|
||||||
|
|
@ -95,11 +94,22 @@ 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: AnimatedCrossFade(
|
child: PageTransitionSwitcher(
|
||||||
firstChild: widget.child,
|
transitionBuilder: (
|
||||||
secondChild: const LockScreen(),
|
Widget child,
|
||||||
crossFadeState: _crossFadeState,
|
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,
|
duration: FluffyThemes.animationDuration,
|
||||||
|
child: _isLocked ? const LockScreen() : widget.child,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue