FirestoreCollection constructor

FirestoreCollection({
  1. required CollectionReference<Object?> collection,
  2. bool initializeOnStart = true,
  3. required List<Query<Object?>> queryList,
  4. required QueryOrder queryOrder,
  5. bool live = false,
  6. bool serverOnly = true,
  7. bool includeMetadataChanges = true,
  8. bool ignoreRemovedUpdate = false,
  9. bool keepDuplicatedDocs = true,
  10. required int offset,
  11. dynamic onNewPage(
    1. int
    )?,
  12. dynamic onDocumentChanged(
    1. DocumentSnapshot<Object?>
    )?,
  13. dynamic onItemRemoved(
    1. String
    )?,
  14. Map<String, dynamic>? fakeRemoveMap,
  15. dynamic shouldUpdate(
    1. DocumentSnapshot<Object?>,
    2. DocumentSnapshot<Object?>
    )?,
})

Implementation

FirestoreCollection({
  required this.collection,
  this.initializeOnStart = true,
  // TODO: merge this field with collection field
  required List<Query> queryList,
  required this.queryOrder,
  this.live = false,
  this.serverOnly = true,
  this.includeMetadataChanges = true,
  this.ignoreRemovedUpdate = false,
  this.keepDuplicatedDocs = true,
  required this.offset,
  this.onNewPage,
  this.onDocumentChanged,
  this.onItemRemoved,
  this.fakeRemoveMap,
  this.shouldUpdate,
}) : assert((queryList.isNotEmpty), 'queryList can not be empty.') {
  log('firestore_collection: $hashCode. created.');
  _ql = queryList;
  _init();
  if (initializeOnStart) {
    restart();
  }
}