getAssetListPaged method

Future<List<AssetEntity>> getAssetListPaged({
  1. required int page,
  2. required int size,
})

Entity list with pagination support.

page should starts with and greater than 0. size is item count of current page.

Implementation

Future<List<AssetEntity>> getAssetListPaged({
  required int page,
  required int size,
}) {
  assert(albumType == 1, 'Only album can request for assets.');
  assert(size > 0, 'Page size must be greater than 0.');

  final filterOption = this.filterOption;

  if (filterOption is FilterOptionGroup) {
    assert(
      type == RequestType.image || !filterOption.onlyLivePhotos,
      'Filtering only Live Photos is only supported '
      'when the request type contains image.',
    );
  }
  return plugin.getAssetListPaged(
    id,
    page: page,
    size: size,
    type: type,
    optionGroup: filterOption,
  );
}