getBucketById method

Future<StorageBucketModel?> getBucketById(
  1. String? id, {
  2. String? subRef,
})

Implementation

Future<StorageBucketModel?> getBucketById(
  String? id, {
  String? subRef,
}) async {
  if (id == null) return _defaultStorageBucket(subRef);
  var bucketPath = BucketsStore.getBucketPath(id);
  if (bucketPath == null) return null;
  StorageBucketModel? storageBucket =
      await StorageBucketModel.fromPath(bucketPath);
  if (storageBucket == null) return null;
  // _repo.add(storageBucket);

  StorageBucketModel actualBucket = await storageBucket.ref(subRef);
  return actualBucket;
}