我想从第一个屏幕导航到第二个屏幕。我想随它发送一些数据。我还需要从后堆栈中清除第一个屏幕,这样当我在第二个屏幕上按下后退按钮时,它不应该进入第一个屏幕。
Navigator.pushReplacement(context, MaterialPageRoute(builder: (context) =>
SecondPage(stuffToSend: "yourStuff")));
class SecondPage{
SecondPage({this.stuffToSend});
var stuffToSend;
//the rest of your code
}
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句