snapshot method

Future<DocumentReference?> snapshot()

Returns a DocumentReference with the latest data from the server or null if the document does not exist on the server.

Implementation

Future<DocumentReference?> snapshot() async {
  if (_isTracked() && _dataManager.getProperties(squidDocId) != null) {
    return this;
  }
  final results =
      await _queryBuilderFactory.getForDocument(_squidDocId).snapshot();
  assert(results.length <= 1,
      'Got more than one doc for the same id: $squidDocId');
  return results.isEmpty ? null : this;
}