Stream value error : Null value received on adding documentsnapshot to BehaviorSubject/ordinary stream

Viewed 115
BehaviorSubject<DocumentSnapshot<Map<String, dynamic>>> getDailyTasks() {
    var stream = db.collection("Daily_tasks").doc(user!.uid).snapshots();

    todoStreamController.sink.addStream(stream);
    print(todoStreamController.value.data()); // returns null

    return todoStreamController;
  }

The above code snippet exposes the repository layer of my bloc(architecture) based application. From the repository layer the stream is used in the streambuilder based UI class.

Attached is the link to the minimal reproduction sample : https://github.com/Pranavvks/Ultimate-to-do-minimal-repd

0 Answers
Related