我有一个带有两个按钮的界面,可以弹出并返回true或false,如下所示:
onPressed: () => Navigator.pop(context, false)
我需要调整应用程序栏中的后退按钮,这样它就会弹出,并且还返回false.有什么办法可以做到这一点吗?
我有一个带有两个按钮的界面,可以弹出并返回true或false,如下所示:
onPressed: () => Navigator.pop(context, false)
我需要调整应用程序栏中的后退按钮,这样它就会弹出,并且还返回false.有什么办法可以做到这一点吗?
这可能会对你有所帮助并对你有用
1st screen个
void goToSecondScreen()async {
var result = await Navigator.push(_context, new MaterialPageRoute(
builder: (BuildContext context) => new SecondScreen(context),
fullscreenDialog: true,)
);
Scaffold.of(_context).showSnackBar(SnackBar(content: Text("$result"),duration: Duration(seconds: 3),));
}
2nd screen个
Navigator.pop(context, "Hello world");