loadMoreAsset method

Future<void> loadMoreAsset({
  1. required AssetPathEntity path,
})

Load more assets

Implementation

Future<void> loadMoreAsset({
  required AssetPathEntity path,
}) async {
  final int page = dataStore.pages[path.id]! + 1;
  final List<AssetEntity> entities = await path.getAssetListPaged(
    page: page,
    size: dataStore.sizePerPage,
  );
  dataStore.pathData[path.id]!.value = <AssetEntity>[
    ...dataStore.pathData[path.id]!.value,
    ...entities
  ];
  dataStore.pages[path.id] = page;
  dataStore.hasMoreToLoad[path.id] =
      dataStore.pathData[path.id]!.value.length < dataStore.totalEntitiesCount[path.id]!;
}