getRecentAssetEntity static method

Future<List<AssetEntity>> getRecentAssetEntity()

TO get File from AssetEntity Iterate on the result then call await element.file element is every item in result

Implementation

static Future<List<AssetEntity>> getRecentAssetEntity() async {
  final isGranted = await checkForPermission();
  if (!isGranted) {
    log("Scanly : Permission is not granted!");
    throw UnimplementedError("Permission is not granted!");
  }
  final List<AssetPathEntity> paths = await PhotoManager.getAssetPathList();
  final List<AssetEntity> entities = await paths.first.getAssetListPaged(page: 0, size: 20);
  return entities;
}