Question: How to update the Homepage just after the `showDialog()` is dismissed/disposed? Doesn't seem like it has an `onDispose()` function.

Found another possible Answer : The `WillPopScope` can help detect if the back button is pressed.

The widget that will be used in the `showDialog`, in its build function the widget can be wrapped in `return new WillPopScope(child: ______, onWillPop: _______);` The code can be run in the `onWillPop` function. This can update the Homepage below.

Answer: 
It really depends on the type of updates you want to have.

However, this is a simple example that may help you figure it out.

[![enter image description here](https://i.stack.imgur.com/C8bhw.gif)](https://i.stack.imgur.com/C8bhw.gif)

```
class Home extends StatefulWidget {
  @override
  _HomeState createState() => new _HomeState();
}

class _HomeState extends State<Home> {
  String _homeData = "initial data";

  @override
  Widget build(BuildContext context) {
    return new Scaffold(
      body: new Center(
        child: new Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            new Text(_homeData),
            new RaisedButton(
              child: new Text("Show Dialog"),
              onPressed: ()async{
                bool shouldUpdate = await showDialog(
                  context: this.context,
                  child:new AlertDialog(
                    content: new FlatButton(
                      child: new Text("update home"),
                      onPressed: () => Navigator.pop(context, true),
                    ),
                  ),
                );
                setState(() {
                  shouldUpdate ? this._homeData = "updated" : null;
                });
              },
            ),
          ],
        ),
      ),
    );
  }
}

```
When tapping outside the dialog the return is null, so I expect a potential null and check for null, which is then false.

```
onPressed: () async {
bool? result = await showDialog(
  context: context,
  builder: (BuildContext context) {
    return AlertDialog(
      title: Text('Select Entity'),
      content: setupAlertDialogContainer(),
    );
  },
);
if (result ?? false) {
  doWhatYouNeedTo();
}

```