import 'package:flutter/material.dart'; import '../../core/constants/app_theme.dart'; import '../library/recipes_screen.dart'; import '../scanner/scanner_screen.dart'; import '../shopping/shopping_lists_screen.dart'; class MainNavigationShell extends StatefulWidget { const MainNavigationShell({super.key}); @override State createState() => _MainNavigationShellState(); } class _MainNavigationShellState extends State { int _currentIndex = 0; final List _screens = const [ RecipesScreen(), ShoppingListsScreen(), ScannerScreen(), ]; @override Widget build(BuildContext context) { return Scaffold( body: IndexedStack( index: _currentIndex, children: _screens, ), bottomNavigationBar: Container( decoration: const BoxDecoration( border: Border( top: BorderSide(color: AppTheme.border, width: 1), ), ), child: NavigationBar( selectedIndex: _currentIndex, backgroundColor: AppTheme.surface, indicatorColor: AppTheme.primary.withOpacity(0.2), onDestinationSelected: (idx) { setState(() { _currentIndex = idx; }); }, destinations: const [ NavigationDestination( icon: Icon(Icons.menu_book_outlined), selectedIcon: Icon(Icons.menu_book, color: AppTheme.primary), label: 'Cookbook', ), NavigationDestination( icon: Icon(Icons.shopping_cart_outlined), selectedIcon: Icon(Icons.shopping_cart, color: AppTheme.primary), label: 'Shopping', ), NavigationDestination( icon: Icon(Icons.document_scanner_outlined), selectedIcon: Icon(Icons.document_scanner, color: AppTheme.primary), label: 'Scanner', ), ], ), ), ); } }