feat: replace Projects tab with More bottom sheet (news/calendar stubs)
This commit is contained in:
+80
-13
@@ -154,12 +154,26 @@ final routerProvider = Provider<GoRouter>((ref) {
|
|||||||
path: Routes.conversations,
|
path: Routes.conversations,
|
||||||
builder: (_, _) => const ConversationsTabScreen(),
|
builder: (_, _) => const ConversationsTabScreen(),
|
||||||
),
|
),
|
||||||
GoRoute(
|
|
||||||
path: Routes.projects,
|
|
||||||
builder: (_, _) => const ProjectsScreen(),
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
GoRoute(
|
||||||
|
path: Routes.projects,
|
||||||
|
builder: (_, _) => const ProjectsScreen(),
|
||||||
|
),
|
||||||
|
GoRoute(
|
||||||
|
path: Routes.news,
|
||||||
|
builder: (_, _) => Scaffold(
|
||||||
|
appBar: AppBar(title: const Text('News')),
|
||||||
|
body: const Center(child: Text('News — coming soon')),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
GoRoute(
|
||||||
|
path: Routes.calendar,
|
||||||
|
builder: (_, _) => Scaffold(
|
||||||
|
appBar: AppBar(title: const Text('Calendar')),
|
||||||
|
body: const Center(child: Text('Calendar — coming soon')),
|
||||||
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
@@ -177,7 +191,6 @@ class _ShellState extends ConsumerState<_Shell> {
|
|||||||
Routes.briefing,
|
Routes.briefing,
|
||||||
Routes.knowledge,
|
Routes.knowledge,
|
||||||
Routes.conversations,
|
Routes.conversations,
|
||||||
Routes.projects,
|
|
||||||
];
|
];
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -210,9 +223,51 @@ class _ShellState extends ConsumerState<_Shell> {
|
|||||||
for (var i = 0; i < _tabs.length; i++) {
|
for (var i = 0; i < _tabs.length; i++) {
|
||||||
if (location.startsWith(_tabs[i])) return i;
|
if (location.startsWith(_tabs[i])) return i;
|
||||||
}
|
}
|
||||||
|
if (location.startsWith(Routes.projects) ||
|
||||||
|
location.startsWith(Routes.news) ||
|
||||||
|
location.startsWith(Routes.calendar)) {
|
||||||
|
return 3;
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void _showMoreSheet(BuildContext context) {
|
||||||
|
showModalBottomSheet<void>(
|
||||||
|
context: context,
|
||||||
|
builder: (_) => SafeArea(
|
||||||
|
child: Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
ListTile(
|
||||||
|
leading: const Icon(Icons.folder_outlined),
|
||||||
|
title: const Text('Projects'),
|
||||||
|
onTap: () {
|
||||||
|
Navigator.pop(context);
|
||||||
|
context.push(Routes.projects);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
ListTile(
|
||||||
|
leading: const Icon(Icons.newspaper_outlined),
|
||||||
|
title: const Text('News'),
|
||||||
|
onTap: () {
|
||||||
|
Navigator.pop(context);
|
||||||
|
context.push(Routes.news);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
ListTile(
|
||||||
|
leading: const Icon(Icons.calendar_month_outlined),
|
||||||
|
title: const Text('Calendar'),
|
||||||
|
onTap: () {
|
||||||
|
Navigator.pop(context);
|
||||||
|
context.push(Routes.calendar);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
void _showUpdateDialog(UpdateState update) {
|
void _showUpdateDialog(UpdateState update) {
|
||||||
showDialog<void>(
|
showDialog<void>(
|
||||||
context: context,
|
context: context,
|
||||||
@@ -303,7 +358,13 @@ class _ShellState extends ConsumerState<_Shell> {
|
|||||||
children: [
|
children: [
|
||||||
NavigationRail(
|
NavigationRail(
|
||||||
selectedIndex: index,
|
selectedIndex: index,
|
||||||
onDestinationSelected: (i) => context.go(_tabs[i]),
|
onDestinationSelected: (i) {
|
||||||
|
if (i == 3) {
|
||||||
|
_showMoreSheet(context);
|
||||||
|
} else {
|
||||||
|
context.go(_tabs[i]);
|
||||||
|
}
|
||||||
|
},
|
||||||
labelType: NavigationRailLabelType.all,
|
labelType: NavigationRailLabelType.all,
|
||||||
destinations: const [
|
destinations: const [
|
||||||
NavigationRailDestination(
|
NavigationRailDestination(
|
||||||
@@ -322,9 +383,9 @@ class _ShellState extends ConsumerState<_Shell> {
|
|||||||
label: Text('Chat'),
|
label: Text('Chat'),
|
||||||
),
|
),
|
||||||
NavigationRailDestination(
|
NavigationRailDestination(
|
||||||
icon: Icon(Icons.folder_outlined),
|
icon: Icon(Icons.more_horiz_outlined),
|
||||||
selectedIcon: Icon(Icons.folder),
|
selectedIcon: Icon(Icons.more_horiz),
|
||||||
label: Text('Projects'),
|
label: Text('More'),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@@ -354,7 +415,13 @@ class _ShellState extends ConsumerState<_Shell> {
|
|||||||
),
|
),
|
||||||
bottomNavigationBar: NavigationBar(
|
bottomNavigationBar: NavigationBar(
|
||||||
selectedIndex: index,
|
selectedIndex: index,
|
||||||
onDestinationSelected: (i) => context.go(_tabs[i]),
|
onDestinationSelected: (i) {
|
||||||
|
if (i == 3) {
|
||||||
|
_showMoreSheet(context);
|
||||||
|
} else {
|
||||||
|
context.go(_tabs[i]);
|
||||||
|
}
|
||||||
|
},
|
||||||
destinations: const [
|
destinations: const [
|
||||||
NavigationDestination(
|
NavigationDestination(
|
||||||
icon: Icon(Icons.wb_sunny_outlined),
|
icon: Icon(Icons.wb_sunny_outlined),
|
||||||
@@ -372,9 +439,9 @@ class _ShellState extends ConsumerState<_Shell> {
|
|||||||
label: 'Chat',
|
label: 'Chat',
|
||||||
),
|
),
|
||||||
NavigationDestination(
|
NavigationDestination(
|
||||||
icon: Icon(Icons.folder_outlined),
|
icon: Icon(Icons.more_horiz_outlined),
|
||||||
selectedIcon: Icon(Icons.folder),
|
selectedIcon: Icon(Icons.more_horiz),
|
||||||
label: 'Projects',
|
label: 'More',
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -17,5 +17,7 @@ abstract class Routes {
|
|||||||
static const quickCapture = '/quick-capture';
|
static const quickCapture = '/quick-capture';
|
||||||
static const settings = '/settings';
|
static const settings = '/settings';
|
||||||
static const briefing = '/briefing';
|
static const briefing = '/briefing';
|
||||||
|
static const news = '/news';
|
||||||
|
static const calendar = '/calendar';
|
||||||
static const projectTasks = '/projects/:id/tasks';
|
static const projectTasks = '/projects/:id/tasks';
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user