title: How can I solve this "build function returned null" error?
body: <p>I am aware this question has been asked a few times and I have tried what was suggested, i.e. placing "return" in the right places. I have also followed the instructions in my console and tried to add an empty Container, but what happens is that my screen turns black. So here is my code:</p>
  
  <pre><code>class SettingsPage extends StatefulWidget {
    @override
    _SettingsPageState createState() =&gt; _SettingsPageState();
  }
  
  class _SettingsPageState extends State&lt;SettingsPage&gt; {
    @override
    Widget build(BuildContext context) {
      bool isSystemSelected;
      final stream = AllowedCallInheritedWidget.of(context).allowedCallStream;
      return StreamBuilder&lt;String&gt;(
        stream: stream,
        builder: (context, snapshot) {
          if (snapshot.data.toString().contains('PRIORITY_SENDERS_CONTACTS')) {
            isSystemSelected = true;
            return AlertDialog(
              backgroundColor: isSystemSelected ? Colors.blueGrey : Colors.amber,
              title: Text(snapshot.data),
            );
          } else if (snapshot.data
              .toString()
              .contains('PRIORITY_SENDERS_STARRED')) {
            isSystemSelected = true;
            return AlertDialog(
              backgroundColor: isSystemSelected ? Colors.blueGrey : Colors.amber,
              title: Text(snapshot.data),
            );
          } else if (snapshot.data.toString().contains('PRIORITY_SENDERS_ANY')) {
            isSystemSelected = true;
            return AlertDialog(
              backgroundColor: isSystemSelected ? Colors.blueGrey : Colors.amber,
              title: Text(snapshot.data),
            );
          }
        },
      );
    }
  }
  </code></pre>
  
  <p>What I am trying to do is update android system changes in real time. Thanks for any help!</p>
  
  <p>Edit: I should add that "The offending widget is: StreamBuilder"</p>