Firebase – How to run async function once in streambuilder
I have a streambuilder that Im trying to call a function that updates the read status on my app void readMessage() async { int num = 0; final query = await FirebaseFirestore.instance .collection('chats') .doc(chatroomId(FirebaseAuth.instance.currentUser!.uid, widget.uid)) .collection('messages') .where('uid', isEqualTo: widget.uid) .where('read',…