DocumentChange class

Represents a change to a document in a query result.

Parameters:

  • doc: The changed document snapshot.
  • newIndex: The index of the document in the new snapshot.
  • oldIndex: The index of the document in the old snapshot.
  • type: The type of change (added, modified, removed).

Returns: An instance of DocumentChange.

Example:

var change = DocumentChange(doc: snapshot, newIndex: 1, oldIndex: 0, type: DocumentChangeType.modified);

Constructors

DocumentChange({required DocumentSnapshot<Object?> doc, required int newIndex, required int oldIndex, required DocumentChangeType type})
DocumentChange.fromJson(dynamic jsonString, dynamic db)
Creates a DocumentChange from JSON data.
factory

Properties

doc → DocumentSnapshot<Object?>
Gets the changed document snapshot.
no setter
hashCode → int
The hash code for this object.
no setterinherited
newIndex → int
Gets the new index of the document.
no setter
oldIndex → int
Gets the old index of the document.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
type → DocumentChangeType
Gets the type of change.
no setter

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → dynamic
Converts the DocumentChange to JSON.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited