import 'package:flutter/material.dart'; import 'sms_list_screen.dart'; import 'settings_screen.dart'; class HomeScreen extends StatefulWidget { const HomeScreen({super.key}); @override State createState() => _HomeScreenState(); } class _HomeScreenState extends State { int _index = 0; @override Widget build(BuildContext context) { return Scaffold( body: IndexedStack( index: _index, children: const [SmsListScreen(), SettingsScreen()], ), bottomNavigationBar: NavigationBar( selectedIndex: _index, onDestinationSelected: (i) => setState(() => _index = i), destinations: const [ NavigationDestination(icon: Icon(Icons.sms_outlined), selectedIcon: Icon(Icons.sms), label: 'Messages'), NavigationDestination(icon: Icon(Icons.settings_outlined), selectedIcon: Icon(Icons.settings), label: 'Settings'), ], ), ); } }