import 'package:flutter/material.dart'; import 'package:workinghours/widgets/monthly/monthlyScreen.dart'; import 'package:workinghours/widgets/yearly/yearlyScreen.dart'; class TabsScreen extends StatefulWidget { const TabsScreen({super.key}); @override State createState() { return _TabsScreenState(); } } class _TabsScreenState extends State { @override void initState() { super.initState(); } int _selectedPageIndex = 0; void _selectPage(int index) { setState(() { _selectedPageIndex = index; }); } @override Widget build(BuildContext context) { Widget activePage = const MonthlyScreen(); var activePageTitle = 'Monthly'; if (_selectedPageIndex == 1) { activePage = const YearlyScreen(); activePageTitle = 'Yearly'; } return Scaffold( appBar: AppBar( title: Text(activePageTitle), ), body: activePage, bottomNavigationBar: BottomNavigationBar( onTap: _selectPage, currentIndex: _selectedPageIndex, items: const [ BottomNavigationBarItem( icon: Icon(Icons.home), // icon: Icon(Icons.tv_outlined), label: 'Monthly', ), BottomNavigationBarItem( icon: Icon(Icons.business), // icon: Icon(Icons.movie), label: 'Yearly', ), ], selectedIconTheme: const IconThemeData(opacity: 0.0, size: 0), unselectedIconTheme: const IconThemeData(opacity: 0.0, size: 0), ), ); } }