gpt4 book ai didi

android - flutter 应用程序 : Required to terminate screen while navigating to next screen

转载 作者:IT王子 更新时间:2023-10-29 07:13:47 26 4
gpt4 key购买 nike

有没有办法在不将 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/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com