mirror of
https://github.com/kuhyx/diet-guard.git
synced 2026-11-24 05:26:26 +01:00
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.
38 lines
1.1 KiB
Dart
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,
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|