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>
This commit is contained in:
42
lib/core/router/router.dart
Normal file
42
lib/core/router/router.dart
Normal file
@@ -0,0 +1,42 @@
|
||||
import 'package:go_router/go_router.dart';
|
||||
|
||||
import 'package:household_keeper/features/home/presentation/home_screen.dart';
|
||||
import 'package:household_keeper/features/rooms/presentation/rooms_screen.dart';
|
||||
import 'package:household_keeper/features/settings/presentation/settings_screen.dart';
|
||||
import 'package:household_keeper/shell/app_shell.dart';
|
||||
|
||||
final router = GoRouter(
|
||||
initialLocation: '/',
|
||||
routes: [
|
||||
StatefulShellRoute.indexedStack(
|
||||
builder: (context, state, navigationShell) =>
|
||||
AppShell(navigationShell: navigationShell),
|
||||
branches: [
|
||||
StatefulShellBranch(
|
||||
routes: [
|
||||
GoRoute(
|
||||
path: '/',
|
||||
builder: (context, state) => const HomeScreen(),
|
||||
),
|
||||
],
|
||||
),
|
||||
StatefulShellBranch(
|
||||
routes: [
|
||||
GoRoute(
|
||||
path: '/rooms',
|
||||
builder: (context, state) => const RoomsScreen(),
|
||||
),
|
||||
],
|
||||
),
|
||||
StatefulShellBranch(
|
||||
routes: [
|
||||
GoRoute(
|
||||
path: '/settings',
|
||||
builder: (context, state) => const SettingsScreen(),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
);
|
||||
Reference in New Issue
Block a user