Browser Web控件浏览器后退按钮
我正在使用导航2和Browser Web控件浏览器后退按钮,browser,flutter-web,back-button,flutter-navigation,Browser,Flutter Web,Back Button,Flutter Navigation,我正在使用导航2和setUrlStrategy(PathUrlStrategy()) 我添加了WillPopScope,但单击浏览器的后退按钮时,不会调用onWillPop Widget build(context) { return WillPopScope( onWillPop: () async { print('here'); if (currentStep == 0) { return false; } return true;
setUrlStrategy(PathUrlStrategy())代码>
我添加了WillPopScope
,但单击浏览器的后退按钮时,不会调用onWillPop
Widget build(context) {
return WillPopScope(
onWillPop: () async {
print('here');
if (currentStep == 0) {
return false;
}
return true;
},
child: Scaffold(...