Zaeem
Zaeem

Reputation: 235

Flutter Image Picker plugin assigns its own name to each picked file

I'm using the image picker plugin for flutter. Whenever I pick an image from the gallery, it is assigned a random name by the plugin, starting with 'image_picker.' How can I get the original name of the image file?

Upvotes: 4

Views: 2258

Answers (1)

Durgesh Kudalkar
Durgesh Kudalkar

Reputation: 59

You can use method as mentioned below. It worked for me

var video = (await _picker.getVideo(source: ImageSource.gallery))!;

var videoName = video.path.split('/').last;

Upvotes: 1

Related Questions