I have a "list page". and an add page. User clicks "add page", goes to a new page where they add some entity. Then I pop the Navigator, and user goes back to "list page".
At this point, I want to get notified somehow - callback maybe? override a method, I am not really sure - and re-read the information from database.
Is there a hook like this in Flutter? Or is there another pattern that I should use?
You can use the location. reload() JavaScript method to reload the current URL. This method functions similarly to the browser's Refresh button. The reload() method is the main method responsible for page reloading.
In javascript, navigation type 2 means browser's back or forward button clicked and the browser is actually taking content from cache. This doesn't work on a single page application, the result is always 1 (which means reload).
In most web browsers you can force a one-time page load from the server by holding down the shift key while clicking on the Reload or Refresh button.
The Navigator.push
method returns a future of the generic type of the Route:
Navigator.of(context) .push(new MaterialPageRoute<String>(...)) .then((String value) { print(value); });
And inside the new route, when you have the value you need:
Navigator.of(context).pop('String');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With