Files
HouseHoldKeaper/lib/shell/app_shell.dart
Jean-Luc Makiola f2dd737e9e feat(01-02): create router, navigation shell, screens, and app shell test
- GoRouter with StatefulShellRoute.indexedStack and 3 branches (Home, Rooms, Settings)
- AppShell with NavigationBar using localized labels and thematic icons
- HomeScreen with empty state and cross-navigation to Rooms tab
- RoomsScreen with empty state and placeholder action button
- SettingsScreen with SegmentedButton theme switcher and About section
- Widget test verifying 3 navigation destinations with correct German labels

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 20:04:59 +01:00

49 lines
1.3 KiB
Dart

import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import 'package:household_keeper/l10n/app_localizations.dart';
class AppShell extends StatelessWidget {
const AppShell({
required this.navigationShell,
super.key,
});
final StatefulNavigationShell navigationShell;
@override
Widget build(BuildContext context) {
final l10n = AppLocalizations.of(context);
return Scaffold(
body: navigationShell,
bottomNavigationBar: NavigationBar(
selectedIndex: navigationShell.currentIndex,
onDestinationSelected: (index) {
navigationShell.goBranch(
index,
initialLocation: index == navigationShell.currentIndex,
);
},
destinations: [
NavigationDestination(
icon: const Icon(Icons.checklist_outlined),
selectedIcon: const Icon(Icons.checklist),
label: l10n.tabHome,
),
NavigationDestination(
icon: const Icon(Icons.door_front_door_outlined),
selectedIcon: const Icon(Icons.door_front_door),
label: l10n.tabRooms,
),
NavigationDestination(
icon: const Icon(Icons.tune_outlined),
selectedIcon: const Icon(Icons.tune),
label: l10n.tabSettings,
),
],
),
);
}
}