title: Flutter pushReplacementNamed().then() does not trigger
body: <p>I am following this udemy course(<a href="https://www.udemy.com/learn-flutter-dart-to-build-ios-android-apps" rel="nofollow noreferrer">https://www.udemy.com/learn-flutter-dart-to-build-ios-android-apps</a>) on flutter, and using scoped_model for state management.
  I want to edit a product from list of products. For that I set the product id as a flag - selectedProductId in scoped model. When submitting, I want to navigate away and set this selectedProductId to null.</p>
  
  <pre><code>//method to edit product    
  editProduct(productId, newValues);
  Navigator.pushReplacementNamed(context, '/productsPage').then((_){
     debugger();
  setSelectedProductId(null);
  }).catchError((err){print(err);});
  </code></pre>
  
  <p>The debugger is never hit. and there is no error either.</p>
  
  <p>I tried using async await and still no use.</p>
  
  <pre><code>editProduct(editableProductId, _formData);
  await Navigator.pushReplacementNamed(context, '/productsPage').catchError((err){print(err);});
  debugger();
  setSelectedProductId(null);
  </code></pre>
  
  <p>the page is navigated to the given route, but the line after, is never executed. I even tried using <code>pushNamed</code> instead of <code>pushReplacementNamed</code>.</p>
  
  <p>I know that <code>pushReplacementNamed</code> returns a future, so .then() must be called, but doesn't seem to happen, am I missing something? Are there any other factors or situations I should know?</p>