feat: switch main navigation to stateful shell tabs
This commit is contained in:
@@ -27,10 +27,10 @@ import '../../features/settings/ui/screens/memory_screen.dart';
|
||||
import '../../features/settings/ui/screens/edit_profile_screen.dart';
|
||||
|
||||
final _homeSecondLevelRoutes = [
|
||||
AppRoutes.homeMain,
|
||||
AppRoutes.calendarDayWeek,
|
||||
AppRoutes.shellHomeBranch,
|
||||
AppRoutes.shellCalendarBranch,
|
||||
AppRoutes.calendarMonth,
|
||||
AppRoutes.todoList,
|
||||
AppRoutes.shellTodoBranch,
|
||||
AppRoutes.settingsMain,
|
||||
];
|
||||
|
||||
|
||||
@@ -5,6 +5,9 @@ class AppRoutes {
|
||||
static const authLogin = '/';
|
||||
|
||||
static const homeMain = '/home';
|
||||
static const shellHomeBranch = homeMain;
|
||||
static const shellCalendarBranch = calendarDayWeek;
|
||||
static const shellTodoBranch = todoList;
|
||||
|
||||
static const messageInviteList = '/messages/invites';
|
||||
static String messageInviteDetail(String id) => '/messages/invites/$id';
|
||||
|
||||
@@ -109,6 +109,7 @@ class BottomDock extends StatelessWidget {
|
||||
return Material(
|
||||
color: Colors.transparent,
|
||||
child: InkWell(
|
||||
key: const ValueKey('bottom_dock_home_button'),
|
||||
onTap: onHomeTap,
|
||||
borderRadius: BorderRadius.circular(AppRadius.xl),
|
||||
child: Container(
|
||||
|
||||
@@ -3,7 +3,7 @@ import 'package:go_router/go_router.dart';
|
||||
|
||||
import '../../../../core/router/app_routes.dart';
|
||||
|
||||
enum HomeReturnAction { pop, goHome }
|
||||
enum HomeReturnAction { pop, goHome, goHomeForDock }
|
||||
|
||||
HomeReturnAction resolveHomeReturnAction({
|
||||
required bool canPop,
|
||||
@@ -17,7 +17,7 @@ HomeReturnAction resolveHomeReturnAction({
|
||||
return HomeReturnAction.goHome;
|
||||
}
|
||||
if (canPop) {
|
||||
return HomeReturnAction.pop;
|
||||
return HomeReturnAction.goHomeForDock;
|
||||
}
|
||||
return HomeReturnAction.goHome;
|
||||
}
|
||||
@@ -37,6 +37,7 @@ void returnToHomePreserveState(
|
||||
context.pop();
|
||||
return;
|
||||
case HomeReturnAction.goHome:
|
||||
case HomeReturnAction.goHomeForDock:
|
||||
context.go(AppRoutes.homeMain);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user