Web 控制浏览器后退按钮

时间:2021-04-29 22:04:39

标签: 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;
  },
  child: Scaffold(...

0 个答案:

没有答案