snapshot static method

dynamic snapshot({
  1. required String collectionName,
  2. List<FireWhereField>? where,
  3. FireOrder? orderBy,
})

Implementation

static snapshot({
  required String collectionName,
  List<FireWhereField>? where,
  FireOrder? orderBy,
}) {
  var ref = getRef(
    collectionName: collectionName,
    where: where,
    orderBy: orderBy,
  );

  try {
    if (Platform.isWindows) {
      return (ref as FireDartCollectionReference).stream;
    } else {
      return (ref as fs.CollectionReference).snapshots();
    }
  } on Exception catch (_) {
    print(_);
  }
}