title: Updating a widget when a global variable changes (Async) in Flutter
body: <p>I am fairly new to Flutter and I find myself in a hole I have dug.</p>
  
  <p>What I want to accomplish is quite simple. I have a global variable. Let's say <code>var PlayerPointsToAdd</code>. Then I have this Stateful Widget that should update itself everytime this global variable is not zero. I want to be able to call the <code>addPointsToPlayer()</code> from another widget. </p>
  
  <p>So far my understanding of the Stateful widgets end at the <code>setState((){})</code> which I can only call inside the Stateful widget itself. </p>
  
  <p>The code below is inside a container inside a Stateful widget. Whenever this button is pressed, it calls the setState according to the new list that <code>PlayerScoreBoard.add()</code> returns. </p>
  
  <pre><code>...
  child: RaisedButton(
                          onPressed: () {
                            setState(() {
                              if (PointsToAddPlayer != 0) {
                                for (int i = 0; i &lt; PointsToAddPlayer; i++) {
                                  PlayerScoreBoard.add(new Icon(
                                      Icons.check_circle_outline,
                                      size: 11));
                                }
                                PointsToAddPlayer = 0;
                              }
  </code></pre>
  
  <p>I have been reading the documentation and watching the Flutter videos on YouTube so please do not dismiss the question. I am genuinely having trouble understanding this. </p>
  
  <p>I figure I have to use Streams to do this. They seem a bit complicated, but if that's the only way I will use them. Does this mean that I should create a global variable, preferably a class with variables in it and make it stream it's variables to every other widget that needs to update when the variables update. So therefore this ScoreBoard widget must listen to the Stream coming from the global class and update itself. Will this allow me to change the variables in a global class and update the respective widgets to their new states automatically? And does this mean that every widget that relies on variables outside itself must be listening to streams? I would really appreciate an ELI5 to the relationship between Stateful Widgets and Streams. </p>
  
  <p>And because this global data will be updated many times over and over again, using a Future is not possible.</p>
  
  <p>Thank you very much.</p>
  
  <p>I mistakenly said a global class variable. I meant to say something like a Map, where I can have something like <code>gameData.PlayerPoints</code>, or <code>gameData.turn</code>.</p>