我正在使用导航 2 和 setUrlStrategy(PathUrlStrategy());
我添加了 WillPopScope
,但在单击浏览器的后退按钮时未调用 onWillPop
。
Widget build(context) {
return WillPopScope(
onWillPop: () async {
print('here');
if (currentStep == 0) {
return false;
}
return true;
},
child: Scaffold(...