watchWithFinder method

Stream<List<Map<String, dynamic>>> watchWithFinder(
  1. Finder finder
)

Stream of records matching the given finder; emits whenever data changes.

Implementation

Stream<List<Map<String, dynamic>>> watchWithFinder(Finder finder) {
  return _collection
      .query(finder: finder)
      .onSnapshots(_database)
      .map((snapshots) => snapshots.map((snapshot) {
            var map = cloneMap(snapshot.value as Map<String, dynamic>);
            map[ID_KEY] = snapshot.key as int?;
            return Map<String, dynamic>.from(map);
          }).toList());
}