Skip to content

Commit

Permalink
Added camera functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
oltimaloku committed Jan 7, 2024
1 parent 28015b7 commit 49a719f
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions flutter_client/lib/features/home/screens/home_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ class HomeScreen extends StatefulWidget {
class _HomeScreenState extends State<HomeScreen> {
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);
Expand Down Expand Up @@ -75,14 +75,11 @@ class _HomeScreenState extends State<HomeScreen> {
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"),
),
],
Expand Down

0 comments on commit 49a719f

Please sign in to comment.