diet-guard/app/lib/screens/photo_viewer_screen.dart
Krzysztof kuhy Rudnicki 0e9acb9e18 Wire theme.dart into the app; replace remaining raw Colors.* literals
main.dart now builds MaterialApp's theme from buildAppTheme() instead of
ColorScheme.fromSeed(Colors.teal) -- theme.dart existed but was never
actually used until this commit. photo_viewer_screen.dart,
settings_screen.dart, and day_status_calendar.dart's raw Colors.*
literals (Colors.black, Colors.red, Colors.white38, Colors.grey.shade800,
...) now read from Theme.of(context) instead.

Also rewrites CLAUDE.md's Visual Design & Theming section, which
previously contradicted the unified-design-system skill (noise texture,
multi-layered shadows, ColorScheme.fromSeed -- all things that skill
explicitly forbids).

This was the other prerequisite the on-fill/warm-palette fixes actually
needed: theme.dart existing but unwired meant the app was still running
Flutter's default seeded theme.
2026-07-21 21:50:16 +02:00

38 lines
1.1 KiB
Dart

/// Full-screen, pinch-to-zoom view of a locally attached meal photo.
library;
import 'package:diet_guard_app/widgets/attached_image.dart';
import 'package:flutter/material.dart';
/// Shows the image at [path] full-screen, with pinch-to-zoom and a back
/// button to dismiss.
class PhotoViewerScreen extends StatelessWidget {
/// Creates a [PhotoViewerScreen] for the photo at [path].
const PhotoViewerScreen({required this.path, super.key});
/// Blob key of the image to display (a file path on Android, an IndexedDB
/// key in the desktop web build).
final String path;
@override
Widget build(BuildContext context) {
final scheme = Theme.of(context).colorScheme;
return Scaffold(
backgroundColor: scheme.surface,
appBar: AppBar(
backgroundColor: scheme.surface,
foregroundColor: scheme.onSurface,
),
body: Center(
child: InteractiveViewer(
child: AttachedImage(
path: path,
errorIconSize: 64,
errorIconColor: scheme.onSurface,
),
),
),
);
}
}