getLatestMediaFile method
- [int count = 50]
Implementation
Future<List<AssetEntity>> getLatestMediaFile([int count = 50]) async {
if (!await checkPhotosPermission()) return null;
try {
var result = await _channel.invokeMethod('getLatestMediaFile', count);
if (result is List && result.isNotEmpty) {
List<AssetEntity> itemList = [];
for (var tempItem in result) {
itemList.add(AssetEntity.fromJson(Map<String, dynamic>.from(tempItem)));
}
return itemList;
}
} catch (e) {}
return null;
}