I want to display the no. of documents in collection in Realtime.[In image 4 document][1] [1]: https://i.stack.imgur.com/VLiDy.jpg
countDocuments() async {
QuerySnapshot _myDoc = await collectionReference.get();
List myDocCount = _myDoc.docs;
var totalStudent = myDocCount.length.toString();
return print(totalStudent);
}
In above code when I called countDocument() function in raised button or any button type it print the total document present in collection in DEBUG CONSOLE of VS code BUT I want to display this No. in inside of Scaffold's Text() widget. So, how I Can display.