addDataChangeListner method

  1. @override
void addDataChangeListner(
  1. Type model,
  2. String docId,
  3. Function onDataChanged
)
override

Implementation

@override
void addDataChangeListner(Type model, String docId, Function onDataChanged) {
  String collectionname = model.toString();
  _usersStream = _db.collection(collectionname).doc(docId).snapshots();

  _usersStream.listen(
    (DocumentSnapshot<Object?> event) {
      onDataChanged(event.data());
    },
  );
}