68 lines
1.8 KiB
Dart
68 lines
1.8 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'dashboard_screen.dart';
|
|
import 'tasks_screen.dart';
|
|
import 'mind_map_screen.dart';
|
|
import 'calendar_screen.dart';
|
|
import 'alarms_screen.dart';
|
|
|
|
class HomeScreen extends StatefulWidget {
|
|
const HomeScreen({super.key});
|
|
|
|
@override
|
|
State<HomeScreen> createState() => _HomeScreenState();
|
|
}
|
|
|
|
class _HomeScreenState extends State<HomeScreen> {
|
|
int _selectedIndex = 0;
|
|
|
|
final List<Widget> _screens = [
|
|
const DashboardScreen(),
|
|
const TasksScreen(),
|
|
const MindMapScreen(),
|
|
const CalendarScreen(),
|
|
const AlarmsScreen(),
|
|
];
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
body: _screens[_selectedIndex],
|
|
bottomNavigationBar: NavigationBar(
|
|
selectedIndex: _selectedIndex,
|
|
onDestinationSelected: (index) {
|
|
setState(() {
|
|
_selectedIndex = index;
|
|
});
|
|
},
|
|
destinations: const [
|
|
NavigationDestination(
|
|
icon: Icon(Icons.dashboard_outlined),
|
|
selectedIcon: Icon(Icons.dashboard),
|
|
label: 'Главная',
|
|
),
|
|
NavigationDestination(
|
|
icon: Icon(Icons.task_outlined),
|
|
selectedIcon: Icon(Icons.task),
|
|
label: 'Задачи',
|
|
),
|
|
NavigationDestination(
|
|
icon: Icon(Icons.account_tree_outlined),
|
|
selectedIcon: Icon(Icons.account_tree),
|
|
label: 'Mind-карта',
|
|
),
|
|
NavigationDestination(
|
|
icon: Icon(Icons.calendar_today_outlined),
|
|
selectedIcon: Icon(Icons.calendar_today),
|
|
label: 'Календарь',
|
|
),
|
|
NavigationDestination(
|
|
icon: Icon(Icons.alarm_outlined),
|
|
selectedIcon: Icon(Icons.alarm),
|
|
label: 'Будильники',
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|