Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between the camera and image picker plugins?

Tags:

flutter

I’m pretty new in flutter. So bear with me. I’m not sure the difference between plugin “camera” and “image picker”. I was able to capture video and image by using “image picker”. From my perspective,”image picker” is more straightforward and easy to implement but on the internet, seems like “camera” plugin is more popular. Then I want to ask, when it comes to taking video and picture, especially video. Is there any pros and cons? Any help appreciated!

like image 892
Daibaku Avatar asked Aug 12 '18 16:08

Daibaku


People also ask

What is the use of image picker?

expo-image-picker provides access to the system's UI for selecting images and videos from the phone's library or taking a photo with the camera.

What is image picker in react native?

A React Native module that allows you to select a photo/video from the device library or camera.

How do you get pictures from your camera and gallery on flutter?

Flutter comes with an image picker plugin for picking images from the device gallery or taking new pictures from the camera. The image_picker plugin exposes some helpful methods from the ImagePicker class it exports: import 'package:image_picker/image_picker. dart'; ImagePicker picker = ImagePicker();


1 Answers

The two plugins differ in functionality and most importantly in purpose:

  • camera allows you to embed the camera feed into your own application as a widget, i.e. have control over it as well.

  • The image_picker plugin will launch a different application (a camera or gallery application) and return a File (an image or video file selected by the user in the other application) to your own application.

If you want to implement (and customize) the camera for you own purposes, you will have to use camera, but if you only want to retrieve imagery or video from the user, image_picker will be your choice.

like image 90
creativecreatorormaybenot Avatar answered Sep 20 '22 18:09

creativecreatorormaybenot