Skip to content

Commit

Permalink
Remove transitions on top-level routes
Browse files Browse the repository at this point in the history
  • Loading branch information
Nexerate committed Oct 20, 2024
1 parent 38ca3ec commit 83bcd45
Showing 1 changed file with 20 additions and 16 deletions.
36 changes: 20 additions & 16 deletions lib/router.dart
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,11 @@ final GoRouter router = GoRouter(
routes: [
GoRoute(
path: '/',
builder: (BuildContext context, GoRouterState state) {
return const HomePage();
},
pageBuilder: (context, state) => CustomTransitionPage(
key: state.pageKey,
child: HomePage(),
transitionsBuilder: (context, animation, secondaryAnimation, child) => child,
),
routes: [
GoRoute(path: 'info', builder: (context, state) => const InfoPage()),
_eventsSubRoute,
Expand Down Expand Up @@ -205,22 +207,22 @@ final GoRouter router = GoRouter(
),
GoRoute(
path: '/calendar',
builder: (context, state) {
if (Authenticator.isLoggedIn()) {
return const FeedPageDisplay();
} else {
return const NotLoggedInPage();
}
},
pageBuilder: (context, state) => CustomTransitionPage(
key: state.pageKey,
child: Authenticator.isLoggedIn() ? const FeedPageDisplay() : const NotLoggedInPage(),
transitionsBuilder: (context, animation, secondaryAnimation, child) => child,
),
routes: [
_eventSubRoute,
],
),
GoRoute(
path: '/social',
builder: (context, state) {
return const GamesPage();
},
pageBuilder: (context, state) => CustomTransitionPage(
key: state.pageKey,
child: GamesPage(),
transitionsBuilder: (context, animation, secondaryAnimation, child) => child,
),
routes: [
GoRoute(
path: 'songs',
Expand Down Expand Up @@ -313,9 +315,11 @@ final GoRouter router = GoRouter(
),
GoRoute(
path: '/menu',
builder: (BuildContext context, GoRouterState state) {
return const MenuPageDisplay();
},
pageBuilder: (context, state) => CustomTransitionPage(
key: state.pageKey,
child: MenuPageDisplay(),
transitionsBuilder: (context, animation, secondaryAnimation, child) => child,
),
routes: [
GoRoute(
path: 'profile',
Expand Down

0 comments on commit 83bcd45

Please sign in to comment.