import 'package:flutter/material.dart'; import 'home_screen.dart'; class BerandaScreen extends StatefulWidget { const BerandaScreen({super.key}); static const routeName = '/beranda'; @override State createState() => _BerandaScreenState(); } class _BerandaScreenState extends State { int _selectedIndex = 0; final List _pages = [ const HomeScreen(), const Center( child: Text('Profil Page'), ), ]; void _onItemTapped(int index) { setState(() { _selectedIndex = index; }); } @override Widget build(BuildContext context) { return Scaffold( body: _pages[_selectedIndex], bottomNavigationBar: NavigationBar( selectedIndex: _selectedIndex, onDestinationSelected: _onItemTapped, destinations: const [ NavigationDestination( icon: Icon(Icons.home_outlined), selectedIcon: Icon(Icons.home), label: 'Beranda', ), NavigationDestination( icon: Icon(Icons.person_outline), selectedIcon: Icon(Icons.person), label: 'Profil', ), ], ), ); } }