chore: make homepage a subroute of /rooms so that the state of /rooms will be maintained when navigating between them (#2829)
This commit is contained in:
parent
18ebc03ba3
commit
c5b7b550f2
4 changed files with 37 additions and 40 deletions
|
|
@ -188,43 +188,6 @@ abstract class AppRoutes {
|
|||
),
|
||||
],
|
||||
),
|
||||
ShellRoute(
|
||||
pageBuilder: chatListShellRouteBuilder,
|
||||
routes: [
|
||||
GoRoute(
|
||||
path: '/homepage',
|
||||
redirect: loggedOutRedirect,
|
||||
pageBuilder: (context, state) => defaultPageBuilder(
|
||||
context,
|
||||
state,
|
||||
const SuggestionsPage(),
|
||||
),
|
||||
routes: [
|
||||
...newRoomRoutes,
|
||||
GoRoute(
|
||||
path: '/planner',
|
||||
pageBuilder: (context, state) => defaultPageBuilder(
|
||||
context,
|
||||
state,
|
||||
const ActivityPlannerPage(),
|
||||
),
|
||||
redirect: loggedOutRedirect,
|
||||
routes: [
|
||||
GoRoute(
|
||||
path: '/generator',
|
||||
redirect: loggedOutRedirect,
|
||||
pageBuilder: (context, state) => defaultPageBuilder(
|
||||
context,
|
||||
state,
|
||||
const ActivityGenerator(),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
// Pangea#
|
||||
ShellRoute(
|
||||
// Never use a transition on the shell route. Changing the PageBuilder
|
||||
|
|
@ -402,6 +365,40 @@ abstract class AppRoutes {
|
|||
: child,
|
||||
),
|
||||
routes: [
|
||||
// #Pangea
|
||||
GoRoute(
|
||||
path: '/homepage',
|
||||
redirect: loggedOutRedirect,
|
||||
pageBuilder: (context, state) => defaultPageBuilder(
|
||||
context,
|
||||
state,
|
||||
const SuggestionsPage(),
|
||||
),
|
||||
routes: [
|
||||
...newRoomRoutes,
|
||||
GoRoute(
|
||||
path: '/planner',
|
||||
pageBuilder: (context, state) => defaultPageBuilder(
|
||||
context,
|
||||
state,
|
||||
const ActivityPlannerPage(),
|
||||
),
|
||||
redirect: loggedOutRedirect,
|
||||
routes: [
|
||||
GoRoute(
|
||||
path: '/generator',
|
||||
redirect: loggedOutRedirect,
|
||||
pageBuilder: (context, state) => defaultPageBuilder(
|
||||
context,
|
||||
state,
|
||||
const ActivityGenerator(),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
// Pangea#
|
||||
GoRoute(
|
||||
path: 'settings',
|
||||
pageBuilder: (context, state) => defaultPageBuilder(
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ class ActivityPlannerPageAppBar extends StatelessWidget
|
|||
customBorder: const CircleBorder(),
|
||||
onTap: () => roomID != null
|
||||
? context.go('/rooms/$roomID/planner/generator')
|
||||
: context.go("/homepage/planner/generator"),
|
||||
: context.go("/rooms/homepage/planner/generator"),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: theme.colorScheme.surfaceContainerHighest,
|
||||
|
|
|
|||
|
|
@ -180,7 +180,7 @@ class ActivitySuggestionsAreaState extends State<ActivitySuggestionsArea> {
|
|||
),
|
||||
IconButton(
|
||||
icon: const Icon(Icons.menu_outlined),
|
||||
onPressed: () => context.go('/homepage/planner'),
|
||||
onPressed: () => context.go('/rooms/homepage/planner'),
|
||||
tooltip: L10n.of(context).activityPlannerTitle,
|
||||
),
|
||||
],
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ class BottomNavBarState extends State<BottomNavBar> {
|
|||
void onItemTapped(int index) {
|
||||
switch (index) {
|
||||
case 0:
|
||||
context.go('/homepage');
|
||||
context.go('/rooms/homepage');
|
||||
break;
|
||||
case 1:
|
||||
context.go('/rooms');
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue