getDCIM method
Future<List>
getDCIM({
- DateTime? fromDate,
- int? limit,
- bool orderByDesc = true,
- bool sortBySize = false,
- bool sortByName = false,
- String? keyword,
override
Fetches media from DCIM folder.
Implementation
@override
Future<List<dynamic>> getDCIM({
DateTime? fromDate,
int? limit,
bool orderByDesc = true,
bool sortBySize = false,
bool sortByName = false,
String? keyword,
}) async {
final Map<String, dynamic> arguments = {
'fromDate': fromDate?.millisecondsSinceEpoch,
'limit': limit,
'orderByDesc': orderByDesc,
'sortBySize': sortBySize,
'sortByName': sortByName,
'keyword': keyword,
};
final result = await methodChannel.invokeMethod<List>('getDCIM', arguments);
if (result == null) return [];
return result.map((e) {
final map = Map<String, dynamic>.from(e as Map);
if (map['mimeType'].toString().startsWith('video/')) {
return VideoModel.fromMap(map);
} else {
return ImageModel.fromMap(map);
}
}).toList();
}