title: Flutter - Show alert dialog after StreamBuilder loaded data and UI
body: <p>I want to show an alert dialog after I get data from StreamBuilder. I also have a UI to render. Currently, I'm having an error like this when I'm trying to build dialog inside <code>_loadUI</code> method before returning actual UI.</p>
  
  <blockquote>
    <p>setState() or markNeedsBuild() called during build.</p>
  </blockquote>
  
  <p>Code:</p>
  
  <pre><code>if (dataSnapshot.hasData) {
              return dataSnapshot.data ? _loadUI(dataSnapshot.data) : _emptyView();
            }
  </code></pre>