get method

Future get({
  1. String? streamId,
})

Implementation

Future<dynamic> get({String? streamId}) async {
  if ((parent != null && !await parent!.hasCollectionId(collectionId)) ||
      (parent == null &&
          !await storageDatabase.checkCollectionIdExists(collectionId))) {
    throw StorageDatabaseException(
      "This collection ($collectionId) has not yet been created",
    );
  }

  dynamic collectionData = (parent != null
      ? (await parent!.get())[collectionId]
      : await storageDatabase.source.getData(collectionId));

  if (streamId != null && storageListeners.hasStreamId(path, streamId)) {
    storageListeners.getDate(path, streamId);
  }

  return collectionData;
}