feature/ai-image #4

Merged
v4l3n71n merged 9 commits from feature/ai-image into main 2024-07-17 20:56:08 +00:00
Showing only changes of commit 216c403625 - Show all commits

View File

@ -34,19 +34,25 @@ class MyApp extends StatelessWidget {
} }
} }
// A widget that displays the picture taken by the user. // A screen that allows users to take a picture using a given camera.
class DisplayPictureScreen extends StatelessWidget { class DisplayPictureScreen extends StatefulWidget {
final String imagePath; final String imagePath;
const DisplayPictureScreen({super.key, required this.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<DisplayPictureScreen> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: AppBar(title: const Text('Display the Picture')), appBar: AppBar(title: const Text('Display the Picture')),
// The image is stored as a file on the device. Use the `Image.file` // The image is stored as a file on the device. Use the `Image.file`
// constructor with the given path to display the image. // constructor with the given path to display the image.
body: Image.file(File(imagePath)), body: Image.file(File(widget.imagePath)),
); );
} }
} }