From 216c4036259b045fdd37524a9ece4728414c94ba Mon Sep 17 00:00:00 2001 From: Valentin CZERYBA Date: Mon, 8 Jul 2024 23:01:07 +0200 Subject: [PATCH] separate cass displayscreenstate --- covas_mobile/lib/pages/DisplayPictureScreen.dart | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/covas_mobile/lib/pages/DisplayPictureScreen.dart b/covas_mobile/lib/pages/DisplayPictureScreen.dart index e3b44e2..c237760 100644 --- a/covas_mobile/lib/pages/DisplayPictureScreen.dart +++ b/covas_mobile/lib/pages/DisplayPictureScreen.dart @@ -34,19 +34,25 @@ class MyApp extends StatelessWidget { } } -// A widget that displays the picture taken by the user. -class DisplayPictureScreen extends StatelessWidget { +// A screen that allows users to take a picture using a given camera. +class DisplayPictureScreen extends StatefulWidget { final String imagePath; const DisplayPictureScreen({super.key, required this.imagePath}); + @override + DisplayPictureScreenState createState() => DisplayPictureScreenState(); +} + +// A widget that displays the picture taken by the user. +class DisplayPictureScreenState extends State { @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar(title: const Text('Display the Picture')), // The image is stored as a file on the device. Use the `Image.file` // constructor with the given path to display the image. - body: Image.file(File(imagePath)), + body: Image.file(File(widget.imagePath)), ); } }