import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; class AppShell extends StatelessWidget { const AppShell({super.key, required this.navigationShell}); final StatefulNavigationShell navigationShell; void _onTap(int index) { navigationShell.goBranch( index, initialLocation: index == navigationShell.currentIndex, ); } @override Widget build(BuildContext context) { return Scaffold( body: navigationShell, bottomNavigationBar: NavigationBar( selectedIndex: navigationShell.currentIndex, onDestinationSelected: _onTap, destinations: const [ NavigationDestination( icon: Icon(Icons.explore_outlined), selectedIcon: Icon(Icons.explore), label: 'Catalog', ), NavigationDestination( icon: Icon(Icons.collections_bookmark_outlined), selectedIcon: Icon(Icons.collections_bookmark), label: 'Library', ), NavigationDestination( icon: Icon(Icons.history_outlined), selectedIcon: Icon(Icons.history), label: 'History', ), NavigationDestination( icon: Icon(Icons.download_outlined), selectedIcon: Icon(Icons.download), label: 'Downloads', ), ], ), ); } }