I use firebase in almost all my app and after a doc is added I add it to a variable to structure the data and organize it but however when app is terminated then ran again the variable resets although firebase docs are added to it in the first place.
How can I fix that?
An example clarifying what I mean:
//add to firebase
final doc = <String, dynamic>{
'docType':'firebase'
};
await collection.add(doc);
//add to a model's variable
context.read<Model>().addDoc(doc['docType']);