Phase 2 of Organizr Migration - Front Hall restructure: - Add FrontHallState provider with three modes (dashboard, iframe, settings) - Create QuickLinksPanel widget with categorized links and overflow menus - Add IframeView with platform-aware implementation (web iframe, mobile fallback) - Extract DashboardContent from FrontHallPage - Add QuickLinkSettingsContent placeholder for Phase 4 link editor - Implement QuickLink entity and data layer with Core API datasource - Add default quick links fallback when API unavailable - Update UI_LAYOUT.md with Front Hall panel configurations 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
65 lines
2.0 KiB
Dart
65 lines
2.0 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|
import 'package:tatlock_ui/features/front_hall/presentation/providers/front_hall_state_provider.dart';
|
|
import 'package:tatlock_ui/features/front_hall/presentation/widgets/dashboard_content.dart';
|
|
import 'package:tatlock_ui/features/front_hall/presentation/widgets/iframe_view.dart';
|
|
import 'package:tatlock_ui/features/front_hall/presentation/widgets/quick_link_settings_content.dart';
|
|
import 'package:tatlock_ui/features/front_hall/presentation/widgets/quick_links_panel.dart';
|
|
|
|
/// Front Hall - estate overview and quick access.
|
|
///
|
|
/// Three-mode content area:
|
|
/// - Dashboard: Stats, weather, welcome message
|
|
/// - Iframe: Embedded external content (web only)
|
|
/// - Settings: Quick link management
|
|
class FrontHallPage extends ConsumerWidget {
|
|
const FrontHallPage({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context, WidgetRef ref) {
|
|
final colorScheme = Theme.of(context).colorScheme;
|
|
final frontHallState = ref.watch(frontHallStateProvider);
|
|
|
|
return Row(
|
|
children: [
|
|
// Left panel - Quick Links
|
|
const QuickLinksPanel(),
|
|
|
|
// Vertical divider
|
|
VerticalDivider(
|
|
width: 1,
|
|
thickness: 1,
|
|
color: colorScheme.outlineVariant,
|
|
),
|
|
|
|
// Main content area - switches based on mode
|
|
Expanded(
|
|
child: _buildContent(context, ref, frontHallState),
|
|
),
|
|
],
|
|
);
|
|
}
|
|
|
|
Widget _buildContent(
|
|
BuildContext context,
|
|
WidgetRef ref,
|
|
FrontHallState state,
|
|
) {
|
|
switch (state.mode) {
|
|
case FrontHallMode.dashboard:
|
|
return const DashboardContent();
|
|
|
|
case FrontHallMode.iframe:
|
|
return IframeView(
|
|
url: state.activeIframeUrl!,
|
|
title: state.activeIframeTitle ?? 'External Content',
|
|
onClose: () =>
|
|
ref.read(frontHallStateProvider.notifier).showDashboard(),
|
|
);
|
|
|
|
case FrontHallMode.settings:
|
|
return const QuickLinkSettingsContent();
|
|
}
|
|
}
|
|
}
|