77 lines
2.8 KiB
Dart
77 lines
2.8 KiB
Dart
import 'package:auto_route/auto_route.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:trainhub_flutter/core/theme/app_colors.dart';
|
|
import 'package:trainhub_flutter/core/router/app_router.dart';
|
|
|
|
@RoutePage()
|
|
class ShellPage extends StatelessWidget {
|
|
const ShellPage({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return AutoTabsRouter(
|
|
routes: const [
|
|
HomeRoute(),
|
|
TrainingsRoute(),
|
|
AnalysisRoute(),
|
|
CalendarRoute(),
|
|
ChatRoute(),
|
|
],
|
|
builder: (context, child) {
|
|
final tabsRouter = AutoTabsRouter.of(context);
|
|
return Scaffold(
|
|
body: Row(
|
|
children: [
|
|
// NavigationRail with logo area at top
|
|
NavigationRail(
|
|
selectedIndex: tabsRouter.activeIndex,
|
|
onDestinationSelected: tabsRouter.setActiveIndex,
|
|
labelType: NavigationRailLabelType.all,
|
|
leading: Padding(
|
|
padding: const EdgeInsets.symmetric(vertical: 16),
|
|
child: Column(
|
|
children: [
|
|
Icon(Icons.fitness_center, color: AppColors.accent, size: 28),
|
|
const SizedBox(height: 4),
|
|
Text('TrainHub', style: TextStyle(color: AppColors.textPrimary, fontSize: 10, fontWeight: FontWeight.w600)),
|
|
],
|
|
),
|
|
),
|
|
destinations: const [
|
|
NavigationRailDestination(
|
|
icon: Icon(Icons.dashboard_outlined),
|
|
selectedIcon: Icon(Icons.dashboard),
|
|
label: Text('Home'),
|
|
),
|
|
NavigationRailDestination(
|
|
icon: Icon(Icons.fitness_center_outlined),
|
|
selectedIcon: Icon(Icons.fitness_center),
|
|
label: Text('Trainings'),
|
|
),
|
|
NavigationRailDestination(
|
|
icon: Icon(Icons.video_library_outlined),
|
|
selectedIcon: Icon(Icons.video_library),
|
|
label: Text('Analysis'),
|
|
),
|
|
NavigationRailDestination(
|
|
icon: Icon(Icons.calendar_today_outlined),
|
|
selectedIcon: Icon(Icons.calendar_today),
|
|
label: Text('Calendar'),
|
|
),
|
|
NavigationRailDestination(
|
|
icon: Icon(Icons.chat_bubble_outline),
|
|
selectedIcon: Icon(Icons.chat_bubble),
|
|
label: Text('AI Chat'),
|
|
),
|
|
],
|
|
),
|
|
const VerticalDivider(thickness: 1, width: 1),
|
|
Expanded(child: child),
|
|
],
|
|
),
|
|
);
|
|
},
|
|
);
|
|
}
|
|
}
|