I am running into a globalKey error after I navigate from Screen A to Screen B and click a \"Cancel\" button to go back to Scree
Thanks to Gunter's commments, I determined that this is because the Screens are not being properly disposed.
Flutter's pushReplacement makes a call to Route.dispose which will ultimately dispose the screen.
I am still unsure as to this comes into play:
widget must be inserted into the new location in the same animation frame
I'm not sure what situation would benefit from such trickery. However, my problem is solved. I just need to make a call to pop or replace.
Here are the available options:
push from A to B and just Navigator.pop from BpushReplacement from A to B and from B to AI've recently started playing with Fluro for routing and there are a few more ways to to handle these situations (Note the optional argument replace):
router.navigateTo(context, route, replace: false) from A to B and Navigator.pop from Brouter.navigateTo(context, route, replace: true) from A to B the same from B to A (the key is replace: true)