getSubCollection method

Future<List<T?>?> getSubCollection(
  1. String subCollection, {
  2. String? docId,
  3. Query<Object?> queryBuilder(
    1. Query<Object?> query
    )?,
})

Implementation

Future<List<T?>?> getSubCollection(
  String subCollection, {
  String? docId,
  Query queryBuilder(Query query)?,
}) async {
  Query? _query =
      _collectionReference.doc(docId ?? this.docId).collection(subCollection);
  if (queryBuilder != null) {
    _query = queryBuilder(_query);
  }
  return await this.get(query: _query);
}