From fa31c0d7a34387ed220d1a7245a51816d59b512c Mon Sep 17 00:00:00 2001 From: Armand <4831c0@proton.me> Date: Sun, 16 Aug 2026 09:51:05 +0200 Subject: [PATCH] feat(home/tt): change transition animation to monthly tt --- firka/lib/routing/app_router.dart | 39 ++++++++++++++++++++++++++++--- 1 file changed, 36 insertions(+), 3 deletions(-) diff --git a/firka/lib/routing/app_router.dart b/firka/lib/routing/app_router.dart index c645dbcf..8254c995 100644 --- a/firka/lib/routing/app_router.dart +++ b/firka/lib/routing/app_router.dart @@ -171,9 +171,12 @@ GoRouter createAppRouter() { routes: [ GoRoute( path: 'monthly', - builder: (context, state) => DefaultAssetBundle( - bundle: FirkaBundle(), - child: HomeTimetableMonthlyScreen(initData), + pageBuilder: (context, state) => _viewSwitchPage( + key: state.pageKey, + child: DefaultAssetBundle( + bundle: FirkaBundle(), + child: HomeTimetableMonthlyScreen(initData), + ), ), ), subjectRoute, @@ -238,3 +241,33 @@ String? _redirect(BuildContext context, GoRouterState state) { return null; } + +CustomTransitionPage _viewSwitchPage({ + required LocalKey key, + required Widget child, +}) { + return CustomTransitionPage( + key: key, + opaque: false, + transitionDuration: const Duration(milliseconds: 300), + reverseTransitionDuration: const Duration(milliseconds: 250), + child: child, + transitionsBuilder: (context, animation, secondaryAnimation, child) { + final curved = CurvedAnimation( + parent: animation, + curve: Curves.easeOut, + reverseCurve: Curves.easeIn, + ); + return FadeTransition( + opacity: curved, + child: SlideTransition( + position: Tween( + begin: const Offset(0, 0.04), + end: Offset.zero, + ).animate(curved), + child: child, + ), + ); + }, + ); +}