From cabd5f5069975e02efd0a1b2fb03421325719b60 Mon Sep 17 00:00:00 2001 From: Vishnu Mohandas Date: Sun, 21 Mar 2021 15:23:21 +0530 Subject: [PATCH] Remove animations from app lock --- lib/ui/app_lock.dart | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/lib/ui/app_lock.dart b/lib/ui/app_lock.dart index 8223174da..d26347358 100644 --- a/lib/ui/app_lock.dart +++ b/lib/ui/app_lock.dart @@ -98,10 +98,18 @@ class _AppLockState extends State with WidgetsBindingObserver { home: this.widget.enabled ? this._lockScreen : this.widget.builder(null), navigatorKey: _navigatorKey, theme: widget.themeData, - routes: { - '/lock-screen': (context) => this._lockScreen, - '/unlocked': (context) => - this.widget.builder(ModalRoute.of(context).settings.arguments) + onGenerateRoute: (settings) { + switch (settings.name) { + case '/lock-screen': + return PageRouteBuilder( + pageBuilder: (_, __, ___) => this._lockScreen); + case '/unlocked': + return PageRouteBuilder( + pageBuilder: (_, __, ___) => this + .widget + .builder(settings.arguments)); + } + return PageRouteBuilder(pageBuilder: (_, __, ___) => this._lockScreen); }, ); }