A flutter plugin to get all images and videos from storage. Currently developed for android only.
A flutter plugin to get all images and videos from storage. Supports Android only
Add this to pubspec.yaml
dependencies: media_collector: ^0.0.1
Import the followings.
import 'package:media_collector/media_collector.dart'; import 'package:media_collector/model/image.dart'; import 'package:media_collector/model/video.dart';
And get images and videos as below,
List<Images> images = await MediaCollector.getImages; List<Videos> videos = await MediaCollector.getVideos;
The output will be list of Images/Videos objects. The structure of both type of objects is as follows,
String fileName; String path; double size; //in KB DateTime lastModified; String directory; String extention;