title: Flutter - Run function after showDialog is dismissed
body: <p>I do have an app that creates a AlertDialog when a certain amount of points are reached. In this AlertDialog I added a button that should reset the points. But I do not know how to run a function after the AlertDialog is dismissed.It would be great if somebody could help me with this problem. </p>
  
  <p>With this code I call the AlertDialog:</p>
  
  <pre><code>Future&lt;Null&gt; gewinner(int gewinner_team, List&lt;String&gt; spieler){
      return showDialog(
          context: context,
          barrierDismissible: false,
          builder: (BuildContext context) {
            return GewinnerDialog(gewinner_team,spieler);
          }
      );
    }
  </code></pre>
  
  <p>And this is my code that creates the UI of the AlertDialog:</p>
  
  <pre><code>import 'package:flutter/material.dart';
  import 'spieler_definieren.dart';
  
  class GewinnerDialog extends StatefulWidget{
    int gewinner_team;
    List&lt;String&gt; spieler;
  
    GewinnerDialog(this.gewinner_team, this.spieler);
  
    @override
    State&lt;StatefulWidget&gt; createState() =&gt; new _Gewinner(gewinner_team, spieler);
  }
  
  class _Gewinner extends State&lt;GewinnerDialog&gt;{
    int gewinner_team;
    List&lt;String&gt; spieler;
  
    _Gewinner(this.gewinner_team, this.spieler);
  
  
    @override
    Widget build(BuildContext context) {
      return new AlertDialog(
        content: new SingleChildScrollView(
          child: new Text("Winner")
        ),
        actions: &lt;Widget&gt;[
          //this FlatButton should reset all the points, that are saved into a List&lt;String&gt;
          // in another class
          new FlatButton(
              onPressed: (){
                Navigator.pop(context);
              },
              child: new Row(
                children: &lt;Widget&gt;[
                  Icon(Icons.replay),
                  new Text("New Game") 
  
                ],
              )
          ),
          new FlatButton(
              onPressed: (){
                Navigator.pushReplacement(context, new MaterialPageRoute(builder: (BuildContext context) =&gt; new SpielerDefinieren()));
              },
              child: new Row(
                children: &lt;Widget&gt;[
                  Icon(Icons.person_add),
                  new Text("New Player")
                ],
              )
          )
        ],
      );
    }
  }
  </code></pre>
  
  <p>It would be great if someone could help me with this problem XD</p>