From 85078ec4ecf4fd9cf92f7101978e3a4c554e1da8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Louis-Philippe=20H=C3=A9on?= <83369199+LouisPhilippeHeon@users.noreply.github.com> Date: Thu, 11 Jul 2024 10:57:08 -0400 Subject: [PATCH] =?UTF-8?q?Permettre=20aux=20utilisateurs=20sur=20iOS=20de?= =?UTF-8?q?=20swipe=20pour=20retourner=20=C3=A0=20la=20page=20pr=C3=A9c?= =?UTF-8?q?=C3=A9dente=20(#1014)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Use MaterialPageRoutes * Uniform code style routes * Fix typo * [BOT] Applying format. --------- Co-authored-by: LouisPhilippeHeon --- lib/features/app/navigation/router.dart | 45 +++++++++---------------- 1 file changed, 15 insertions(+), 30 deletions(-) diff --git a/lib/features/app/navigation/router.dart b/lib/features/app/navigation/router.dart index a583607b4..2bebe4fc2 100644 --- a/lib/features/app/navigation/router.dart +++ b/lib/features/app/navigation/router.dart @@ -71,23 +71,9 @@ Route generateRoute(RouteSettings routeSettings) { settings: RouteSettings(name: routeSettings.name), pageBuilder: (_, __, ___) => StudentView()); case RouterPaths.gradeDetails: - return PageRouteBuilder( - transitionDuration: const Duration(milliseconds: 600), - transitionsBuilder: (context, animation, secondaryAnimation, child) { - const begin = Offset(0.0, 1.0); - const end = Offset.zero; - const curve = Curves.ease; - - final tween = - Tween(begin: begin, end: end).chain(CurveTween(curve: curve)); - - return SlideTransition( - position: animation.drive(tween), - child: child, - ); - }, + return MaterialPageRoute( settings: RouteSettings(name: routeSettings.name), - pageBuilder: (_, __, ___) => + builder: (context) => GradesDetailsView(course: routeSettings.arguments! as Course)); case RouterPaths.ets: return PageRouteBuilder( @@ -115,34 +101,33 @@ Route generateRoute(RouteSettings routeSettings) { authorId: routeSettings.arguments! as String, )); case RouterPaths.webView: - return PageRouteBuilder( - pageBuilder: (_, __, ___) => - LinkWebView(routeSettings.arguments! as QuickLink)); + return MaterialPageRoute( + settings: RouteSettings(name: routeSettings.name), + builder: (_) => LinkWebView(routeSettings.arguments! as QuickLink)); case RouterPaths.security: - return PageRouteBuilder( + return MaterialPageRoute( settings: RouteSettings(name: routeSettings.name), - pageBuilder: (_, __, ___) => SecurityView()); + builder: (_) => SecurityView()); case RouterPaths.more: return PageRouteBuilder( settings: RouteSettings(name: routeSettings.name), pageBuilder: (_, __, ___) => MoreView()); case RouterPaths.settings: - return PageRouteBuilder( + return MaterialPageRoute( settings: RouteSettings(name: routeSettings.name), - pageBuilder: (_, __, ___) => SettingsView()); + builder: (_) => SettingsView()); case RouterPaths.contributors: - return PageRouteBuilder( + return MaterialPageRoute( settings: RouteSettings(name: routeSettings.name), - pageBuilder: (_, __, ___) => ContributorsView()); + builder: (_) => ContributorsView()); case RouterPaths.feedback: - return PageRouteBuilder( + return MaterialPageRoute( settings: RouteSettings(name: routeSettings.name), - pageBuilder: (_, __, ___) => FeedbackView()); + builder: (_) => FeedbackView()); case RouterPaths.about: - return PageRouteBuilder( - transitionDuration: const Duration(seconds: 1), + return MaterialPageRoute( settings: RouteSettings(name: routeSettings.name), - pageBuilder: (_, __, ___) => AboutView()); + builder: (_) => AboutView()); case RouterPaths.chooseLanguage: return MaterialPageRoute( settings: RouteSettings(name: routeSettings.name),