getAssetCountFromPath method

Future<void> getAssetCountFromPath(
  1. PathWrapper<AssetPathEntity> path
)

Implementation

Future<void> getAssetCountFromPath(PathWrapper<AssetPathEntity> path) async {
  final int assetCount = await path.path.assetCountAsync;
  final int index = _paths.indexWhere(
    (PathWrapper<AssetPathEntity> p) => p == path,
  );
  if (index != -1) {
    _paths[index] = _paths[index].copyWith(assetCount: assetCount);
    if (index == 0) {
      _currentPath = _currentPath?.copyWith(assetCount: assetCount);
    }
    notifyListeners();
  }
}