Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get both image or video from gallery in flutter?

Tags:

flutter

dart

I want to access the gallery and pick image or video on user choice.

I am building an app where user can upload image or video when they click on the gallery icon. I have used ImagePicker but with ImagePicker I will have to make two separate icon for photo and video. I just want one icon for accessing the gallery and to get video or photo in return.

IconButton(
                  icon: Icon(FontAwesome5.getIconData('file-video')),
                  iconSize: 52.0,
                  onPressed: () =>
                      ImagePicker.pickVideo(source: ImageSource.gallery),
                )
like image 564
Arbaz Irshad Avatar asked Oct 05 '19 12:10

Arbaz Irshad


Video Answer


1 Answers

For accessing to camera and video with only on click you have to use extension "camera" from pub.dev not "image_picker".

like image 135
Kubanych Asanov Avatar answered Oct 06 '22 16:10

Kubanych Asanov