Files
tatlock-ui/lib/shared/layouts/app_scaffold.dart
T
jpmschweitzerandClaude Opus 4.5 a4aaea33b8 refactor: rename features to room-based directory structure
- Rename features/dashboard → features/front_hall
- Update routes: /, /control-room, /parlor, /settings
- Update navigation to 4 rooms (removed chat tab - will be omnipresent dock)
- Add docs/UI_LAYOUT.md with wireframes and responsive specs
- Update ARCHITECTURE.md and PLAN.md to reflect room structure

Directory structure now mirrors "Rooms of the Estate" UI navigation:
- front_hall/ (dashboard)
- control_room/ (infrastructure - containers, stacks, etc.)
- parlor/ (home automation)
- library/ (future)
- study/ (future, hidden)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 23:14:40 +01:00

69 lines
2.1 KiB
Dart

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);
}
}