I am streaming a document using StreamBuilder and it prints HELLO every time there is a change to the document.
StreamBuilder(
stream: FirebaseFirestore.instance.collection('collection').doc('ABC').snapshots();,
builder: (_context, snapshot) {
if (!snapshot.hasData) return CircularProgressIndicator();
print('HELLO');
return Container();
}
Now when I update the document by
onTap: () =>
FirebaseFirestore.instance.collection('collection').doc('ABC').update({'fruit':'apple','color':'golden'}),
the word HELLO gets printed once which is supposed to... However when I update a Timestamp field and a regular field
onTap: () =>
FirebaseFirestore.instance.collection('collection').doc('ABC').update({'fruit':'apple','time': FieldValue.serverTimestamp()}),
the word HELLO gets printed twice in the console.. which is not supposed to..