title: Navigator.push() inside showdialog not working
body: <p>Trying to navigate to a new screen using Navigator.push(), but it's not working.
  I have created a custom class to show AlertDialog and call the class with the object to show alertDialog</p>
  <pre><code>_customerAlertDialog.showConfirmAlertDialog(
     context: context,
     title: &quot;Login In&quot;,
     subTitle: &quot;You need to login to purchase.&quot;,
     onTapResponse: (bool val) async {
       if (val) {
         /// close AlertDialog
         Navigator.of(context).pop();
         Navigator.of(context).push(MaterialPageRoute(builder: (context) =&gt; LoginScreen()));
         print(&quot;show the login screen&quot;);
  
       } else {
         //TODO : when user click no.
       }
     });
  </code></pre>
  <p>navigator.pop() is working,
  print statement is  working,
  but  Navigator.push is not working. Also tried this:</p>
  <pre><code>Navigator.push(context,MaterialPageRoute(builder: (context) =&gt; LoginScreen())); 
  </code></pre>