This StackOverflow answer (How to deal with unwanted widget build?) says that widgets should have no side effects in their build function, and that when using a StreamBuilder, you should not create a stream inline, but initialize in initState in a StatefulWidget.
However, the official cloud_firestore docs show this example:
This example creates the stream in the build function.
Is this truly bad practice, and the Firestore team is just wrong here, or is Firestore doing something under the hood that I don't know about that makes this okay?