feat: Phase 1 foundation - core infrastructure and navigation

Clean Architecture structure:
- core/config - Environment configuration
- core/theme - Material 3 theming with FlexColorScheme
- core/error - Typed exception hierarchy
- core/api - Dio HTTP clients with interceptors
- core/auth - Authentication state management
- routing - go_router with shell navigation
- shared/layouts - Adaptive scaffold

Dependencies added:
- flutter_riverpod, riverpod_annotation, riverpod_generator
- freezed, freezed_annotation, json_serializable
- dio, go_router, shared_preferences
- flex_color_scheme, flutter_adaptive_scaffold

Features:
- Responsive navigation (rail on desktop, bottom on mobile)
- Dashboard placeholder with welcome card
- Theme switching infrastructure
- API client ready for Core API and Tatlock API

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2025-12-30 17:15:54 +01:00
co-authored by Claude Opus 4.5
parent 7d13a02382
commit 3af4fd16f8
18 changed files with 1005 additions and 52 deletions
+107
View File
@@ -0,0 +1,107 @@
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';
import '../shared/layouts/app_scaffold.dart';
import '../features/dashboard/presentation/pages/dashboard_page.dart';
part 'app_router.g.dart';
/// Route paths as constants.
abstract class AppRoutes {
static const dashboard = '/';
static const chat = '/chat';
static const containers = '/containers';
static const containerDetail = '/containers/:id';
static const housekeeping = '/housekeeping';
static const settings = '/settings';
}
/// Provides the GoRouter instance.
@riverpod
GoRouter appRouter(AppRouterRef ref) {
return GoRouter(
initialLocation: AppRoutes.dashboard,
debugLogDiagnostics: true,
routes: [
ShellRoute(
builder: (context, state, child) => AppScaffold(child: child),
routes: [
GoRoute(
path: AppRoutes.dashboard,
name: 'dashboard',
builder: (context, state) => const DashboardPage(),
),
GoRoute(
path: AppRoutes.chat,
name: 'chat',
builder: (context, state) => const _PlaceholderPage(title: 'Chat'),
),
GoRoute(
path: AppRoutes.containers,
name: 'containers',
builder: (context, state) =>
const _PlaceholderPage(title: 'Containers'),
routes: [
GoRoute(
path: ':id',
name: 'containerDetail',
builder: (context, state) {
final id = state.pathParameters['id']!;
return _PlaceholderPage(title: 'Container: $id');
},
),
],
),
GoRoute(
path: AppRoutes.housekeeping,
name: 'housekeeping',
builder: (context, state) =>
const _PlaceholderPage(title: 'Housekeeping'),
),
GoRoute(
path: AppRoutes.settings,
name: 'settings',
builder: (context, state) =>
const _PlaceholderPage(title: 'Settings'),
),
],
),
],
);
}
/// Placeholder page for routes not yet implemented.
class _PlaceholderPage extends StatelessWidget {
const _PlaceholderPage({required this.title});
final String title;
@override
Widget build(BuildContext context) {
return Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(
Icons.construction,
size: 64,
color: Theme.of(context).colorScheme.outline,
),
const SizedBox(height: 16),
Text(
title,
style: Theme.of(context).textTheme.headlineMedium,
),
const SizedBox(height: 8),
Text(
'Coming soon',
style: Theme.of(context).textTheme.bodyLarge?.copyWith(
color: Theme.of(context).colorScheme.outline,
),
),
],
),
);
}
}