select static method
Implementation
static Future<List<Media>> select(
{PictureMimeType type = PictureMimeType.ofAll,
int max = 1,
int spanCount = 4,
isCamera = true,
bool enableCrop = false,
bool compress = true,
int ratioX = 1,
int ratioY = 1,
List<String> selectList = list}) async {
int mimeType = 0;
if (type == PictureMimeType.ofAll) {
mimeType = 0;
} else if (type == PictureMimeType.ofImage) {
mimeType = 1;
} else if (type == PictureMimeType.ofVideo) {
mimeType = 2;
}
Map<String, dynamic> params = {
'type': mimeType,
'max': max,
'spanCount': spanCount,
'isCamera': isCamera,
'enableCrop': enableCrop,
'compress': compress,
'ratioX': ratioX,
'ratioY': ratioY,
'selectList': selectList,
};
List<dynamic> paths = await channel.invokeMethod('select', params);
List<Media> medias = [];
for (var data in paths) {
Media media = Media();
media.path = data['path'];
media.cropPath = data['cropPath'];
media.compressPath = data['compressPath'];
media.width = data['width'];
media.height = data['height'];
medias.add(media);
}
return medias;
}