Files
tatlock-ui/lib/routing/app_router.dart
T
Jeroen SchweitzerandClaude Opus 4.5 3b89ed8c18 feat: add Control Room with containers and stacks management
- Add Control Room page with stacks sidebar and containers list
- Implement container actions (start/stop/restart) with snackbars
- Add container logs viewer dialog
- Add search/filter for both stacks and containers lists
- Add external links for Portainer and Netdata (url_launcher)
- Add VS Code launch configuration for Flutter web debugging

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 02:01:01 +01:00

93 lines
2.6 KiB
Dart

import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';
import '../features/control_room/presentation/pages/control_room_page.dart';
import '../features/front_hall/presentation/pages/front_hall_page.dart';
import '../shared/layouts/app_scaffold.dart';
part 'app_router.g.dart';
/// Route paths as constants.
abstract class AppRoutes {
static const frontHall = '/';
static const controlRoom = '/control-room';
static const containers = '/control-room/containers';
static const containerDetail = '/control-room/containers/:id';
static const parlor = '/parlor';
static const settings = '/settings';
}
/// Provides the GoRouter instance.
@riverpod
GoRouter appRouter(AppRouterRef ref) {
return GoRouter(
initialLocation: AppRoutes.frontHall,
debugLogDiagnostics: true,
routes: [
ShellRoute(
builder: (context, state, child) => AppScaffold(child: child),
routes: [
GoRoute(
path: AppRoutes.frontHall,
name: 'frontHall',
builder: (context, state) => const FrontHallPage(),
),
GoRoute(
path: AppRoutes.controlRoom,
name: 'controlRoom',
builder: (context, state) => const ControlRoomPage(),
),
GoRoute(
path: AppRoutes.parlor,
name: 'parlor',
builder: (context, state) =>
const _PlaceholderPage(title: 'Parlor'),
),
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,
),
),
],
),
);
}
}