From 49a719f448ef60d9a460565bd859191ad80e5fc2 Mon Sep 17 00:00:00 2001 From: oltimaloku Date: Sat, 6 Jan 2024 23:33:20 -0800 Subject: [PATCH] Added camera functionality --- .../lib/features/home/screens/home_screen.dart | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/flutter_client/lib/features/home/screens/home_screen.dart b/flutter_client/lib/features/home/screens/home_screen.dart index 817908c..af1ed25 100644 --- a/flutter_client/lib/features/home/screens/home_screen.dart +++ b/flutter_client/lib/features/home/screens/home_screen.dart @@ -22,9 +22,9 @@ class HomeScreen extends StatefulWidget { class _HomeScreenState extends State { File? image; - Future pickImage() async { + Future pickImage(ImageSource source) async { try { - final image = await ImagePicker().pickImage(source: ImageSource.gallery); + final image = await ImagePicker().pickImage(source: source); if (image == null) return; final imageTemporary = File(image.path); @@ -75,14 +75,11 @@ class _HomeScreenState extends State { const SizedBox(height: 20), const Expanded(child: CustomMap()), ElevatedButton( - onPressed: () => pickImage(), + onPressed: () => pickImage(ImageSource.gallery), child: const Text("Pick Gallery"), ), ElevatedButton( - onPressed: () { - print("viewModel ${geoSphereViewModel.geoSpheres}"); - print("service ${geoSphereService.geoSpheres}"); - }, + onPressed: () => pickImage(ImageSource.camera), child: const Text("Pick Camera"), ), ],