Issue
im getting my "Patients" collection documents in my viewAllPatientsScreen
StreamBuilder<List<Patient>>(
stream: FirebaseApi().getAllPatients,
initialData: [],
builder: (context, snapshot) {
var data = snapshot.data;
and passing each patient info to "ViewPatientInfo Screen" ,
Navigator.of(context)
.push(MaterialPageRoute(
builder: (context) => ViewPatientScreen(
patient: data[index],
)))
from the ViewPatientScreen i can navigate to a third screen which is EditPatientScreen and edit the document values in my firebase.
the problem is after editing the values and navigate to the ViewPatientScreen i see the old values and i have to navigate all the way back to ViewAllPatients Screen where my StreamBuilder is after that i can get the new values in the ViewPatientScreen
is there anyway to keep listening to changes made to the passed parameters through screens or i have to make streamBuilder in All Screens ?
Solution
problem:
the problem is after editing the values and navigate to the ViewPatientScreen i see the old values and i have to navigate all the way back to ViewAllPatients Screen where my StreamBuilder is after that i can get the new values in the ViewPatientScreen
firebase have store the old value to phone so is getting the value from the cache, the best ways is to use steam in the ViewPatientScreen .
Answered By - Gbenga B Ayannuga
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.