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: 
Noticed a couple of the above answers were a bit out of date due to the "child" construct used with the AlertDialog object being deprecated now.

Here is what I use now instead for a blocking alert dialog:

```
          showDialog(
            context: context,
            builder: (BuildContext context) {
              // return object of type Dialog
              return AlertDialog(
                title: new Text("Conversation Request"),
                content:
                    new Text("Have a conversation with this person"),
                actions: <Widget>[
                  // usually buttons at the bottom of the dialog
                  new FlatButton(
                    child: new Text("Accept"),
                    onPressed: () {
                      performAccept();
                    },
                  ),
                  new FlatButton(
                    child: new Text("Ignore"),
                    onPressed: () {
                      performIgnore();
                    },
                  )
                ],
              );
            },
          )

```
For me, I used Bloc state management to handle this.
The idea is:

```
//On Dialog
clickOKAction: () => blocCubit.emitOKActionState()
...

//On the bloc file
fun emitOKActionState(){
   emit(OKActionState());
}

//On Widget
listener: (context, state) async {
   if(state is OKActionState) {
        // HANDLE YOUR ACTION HERE
   }
}

```

Because after showing Dialog, the current widget will be disposed. So you can not use anything related to `context` for eg, because it's unmounted. This may help solve error like:

> 
> This widget has been unmounted, so the State no longer has a context (and should be considered defunct)
> 
> 
>