getAssetListRange method
Getting assets in range using start and end.
The start and end are similar to String.substring, but it'll return
the maximum assets if the total count of assets is fewer than the range,
instead of throwing a RangeError like String.substring.
The length of returned assets might be less than requested. Not existing assets will be excluded from the result.
Implementation
Future<List<AssetEntity>> getAssetListRange({
required int start,
required int end,
}) async {
assert(albumType == 1, 'Only album can request for assets.');
assert(start >= 0, 'The start must be greater than 0.');
assert(end > start, 'The end must be greater than start.');
final filterOption = this.filterOption;
final int count = await assetCountAsync;
if (end > count) {
end = count;
}
return plugin.getAssetListRange(
id,
type: type,
start: start,
end: end,
optionGroup: filterOption,
);
}