How to redirect to specific route on dialog dismiss in Flutter

I created a form that once submitted shows a dialog to the user, like this:

            barrierDismissible: false,
            context: context,
            builder: (BuildContext context) {
              return AlertDialog(
                contentPadding: EdgeInsets.all(0),
                content: Container(
                  child: Wrap(
                    children: [
                        width: double.infinity,
                        margin: EdgeInsets.all(0),
                        padding: EdgeInsets.all(20),
                        decoration: BoxDecoration(gradient: linearGradientCustom),
                        child: Column(
                          children: [

I am not using any button or icon to close the dialog, since the dialog box is quite small and it just makes sense to simply tap away from it to dismiss it.

The issue is that I need to redirect the users to a different route on dismiss, instead of simply popping the dialog context.

How can I achieve this?

Thanks a lot.

Read more here:

Content Attribution

This content was originally published by Giulia at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: