title: Flutter Firestore check if user exists via StreamBuilder:
body: <p>I'm trying to add a check in my app via a StreamBuilder to show users different screens based upon if a user's document exists in Firestore. My code technically works but on hot reload, it shows my 'AddUser' screen for a couple of seconds before moving over to my 'UserHomeScreen'. I was wondering how to rectify this so the 'AddUser' screen does not show my 'AddUser' screen at all if the user document exists.</p>
  <p>Here is my code:</p>
  <pre><code>class UserStream extends StatelessWidget {
    const UserStream({Key? key}) : super(key: key);
    
  
    @override
    Widget build(BuildContext context) {
      FirebaseAuth auth = FirebaseAuth.instance;
       String uid = auth.currentUser!.uid.toString();
      return StreamBuilder&lt;dynamic&gt;(
        stream: FirebaseFirestore.instance.collection('users').doc(uid).snapshots(),
        builder: (context, snapshot) {
          if (snapshot.hasData &amp;&amp; snapshot.data!.exists) {
            return const UserHomeScreen();
          } else {
            return AddUser(youtubeLink: '', bio: '', bioLink: '', displayName: '', instaLink: '', profilePhoto: '', tiktokLink: '', username: '',);
          }
        },
      );
    }
  }
  </code></pre>