有没有办法在不将 flutter screen 添加到屏幕堆栈的情况下终止它?就像我们在 android 中做 finish() 一样?
最佳答案
您可以使用 pushReplacement 或 pushReplacementNamed。
1) 有路线: Navigator.of(context).pushReplacementNamed('/secondPage');
2) Navigator.pushReplacement(context, MaterialPageRoute(builder: (context) => SecondPage()));
关于android - flutter 应用程序 : Required to terminate screen while navigating to next screen,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51167002/