56 lines
1.4 KiB
Dart
56 lines
1.4 KiB
Dart
import 'package:flutter/material.dart';
|
|
import '../utils/constants.dart';
|
|
import 'dashboard_screen.dart';
|
|
import 'home_screen.dart';
|
|
import 'siti_screen.dart';
|
|
import 'profile_screen.dart';
|
|
|
|
class MainScreen extends StatefulWidget {
|
|
const MainScreen({super.key});
|
|
|
|
@override
|
|
State<MainScreen> createState() => _MainScreenState();
|
|
}
|
|
|
|
class _MainScreenState extends State<MainScreen> {
|
|
int _currentIndex = 0;
|
|
|
|
final List<Widget> _screens = [
|
|
const DashboardScreen(),
|
|
const HomeScreen(),
|
|
const SitiScreen(),
|
|
const ProfileScreen(),
|
|
];
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
body: _screens[_currentIndex],
|
|
bottomNavigationBar: BottomNavigationBar(
|
|
currentIndex: _currentIndex,
|
|
onTap: (index) => setState(() => _currentIndex = index),
|
|
selectedItemColor: AppColors.primary,
|
|
unselectedItemColor: AppColors.textSecondary,
|
|
items: const [
|
|
BottomNavigationBarItem(
|
|
icon: Icon(Icons.dashboard),
|
|
label: 'Dashboard',
|
|
),
|
|
BottomNavigationBarItem(
|
|
icon: Icon(Icons.notifications_active),
|
|
label: 'Allarmi',
|
|
),
|
|
BottomNavigationBarItem(
|
|
icon: Icon(Icons.location_on),
|
|
label: 'Siti',
|
|
),
|
|
BottomNavigationBarItem(
|
|
icon: Icon(Icons.person),
|
|
label: 'Profilo',
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|