import 'package:flutter/material.dart'; import 'calculator_home_page.dart'; import 'about_page.dart'; class HomeScreen extends StatefulWidget { const HomeScreen({super.key}); @override State createState() => _HomeScreenState(); } class _HomeScreenState extends State { int _selectedIndex = 0; static const List _widgetOptions = [ CalculatorHomePage(), AboutPage(), ]; void _onItemTapped(int index) { setState(() { _selectedIndex = index; }); } @override Widget build(BuildContext context) { return Scaffold( body: _widgetOptions.elementAt(_selectedIndex), bottomNavigationBar: BottomNavigationBar( items: const [ BottomNavigationBarItem( icon: Icon(Icons.calculate), label: 'Calculator', ), BottomNavigationBarItem(icon: Icon(Icons.info), label: 'About'), ], currentIndex: _selectedIndex, onTap: _onItemTapped, ), ); } }