transform method
Transform the given ref
to a Stream of T
s.
The Stream will emmit new values each time there is a change
in the DB.
Implementation
Stream<T> transform({
required DocumentReference ref,
}) {
return ref
.withConverter(
fromFirestore: _repo.fromSnapshot,
toFirestore: _repo.toMap,
)
.snapshots()
.map<T?>((_) => _.data())
.where((item) => item != null)
.whereType<T>();
}