import 'package:flutter/material.dart'; import 'package:flutter_adaptive_scaffold/flutter_adaptive_scaffold.dart'; import 'package:go_router/go_router.dart'; import '../../routing/app_router.dart'; /// Main application scaffold with adaptive navigation. class AppScaffold extends StatelessWidget { const AppScaffold({super.key, required this.child}); final Widget child; @override Widget build(BuildContext context) { // TODO: Replace AdaptiveScaffold with custom layout per UI_LAYOUT.md // - Header with room tabs (not bottom/rail nav) // - Chat dock on right side return AdaptiveScaffold( selectedIndex: _selectedIndex(context), onSelectedIndexChange: (index) => _onNavSelected(context, index), destinations: const [ NavigationDestination( icon: Icon(Icons.door_front_door_outlined), selectedIcon: Icon(Icons.door_front_door), label: 'Front Hall', ), NavigationDestination( icon: Icon(Icons.dns_outlined), selectedIcon: Icon(Icons.dns), label: 'Control Room', ), NavigationDestination( icon: Icon(Icons.weekend_outlined), selectedIcon: Icon(Icons.weekend), label: 'Parlor', ), NavigationDestination( icon: Icon(Icons.settings_outlined), selectedIcon: Icon(Icons.settings), label: 'Settings', ), ], body: (_) => child, smallBody: (_) => child, useDrawer: false, ); } int _selectedIndex(BuildContext context) { final location = GoRouterState.of(context).matchedLocation; if (location.startsWith(AppRoutes.controlRoom)) return 1; if (location.startsWith(AppRoutes.parlor)) return 2; if (location.startsWith(AppRoutes.settings)) return 3; return 0; // Front Hall } void _onNavSelected(BuildContext context, int index) { final route = switch (index) { 0 => AppRoutes.frontHall, 1 => AppRoutes.controlRoom, 2 => AppRoutes.parlor, 3 => AppRoutes.settings, _ => AppRoutes.frontHall, }; context.go(route); } }