Reputation: 235
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
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