flutter_boost icon indicating copy to clipboard operation
flutter_boost copied to clipboard

WillPopScope在v3.0_release.1失效问题

Open JDongKhan opened this issue 3 years ago • 1 comments

Android物理键返回不触发WillPopScope事件,经过定位发现FlutterBoostAppState 里面的pop方法执行canpop并不能触发WillPopScope的调用,需要将canpop更改为maybepop。


final handled = onBackPressed? await _performBackPressed(container, result): await container?.navigator?.maybePop(result);

同样的FlutterBoostAppState里面的build的onWillPop逻辑pop也不会触发WillPopScope,需要更改为maybepop。

 onWillPop: () async {
          final canPop = topContainer.navigator.canPop();
          if (canPop) {
            topContainer.navigator.maybePop();
            return false;
          }
         return false;
 },

JDongKhan avatar Mar 29 '22 09:03 JDongKhan

FlutterBoost的demo运行正常(如视频),@JDongKhan 你是什么场景?

https://github.com/alibaba/flutter_boost/blob/master/example/lib/case/willpop.dart

https://user-images.githubusercontent.com/26625149/182137097-3e6ea4b6-8da5-4e27-9329-659333e27869.mp4

0xZOne avatar Aug 01 '22 11:08 0xZOne

不能复现问题。

0xZOne avatar Aug 11 '22 13:08 0xZOne

BoostNavigator.instance.pop(); 不会触发WillPopScope v3.0-null-safety-release.2.1

shuigesuntao avatar Nov 03 '22 06:11 shuigesuntao

这个问题解决了吗。我遇到了同样的问题

colorfulldays avatar Nov 02 '23 08:11 colorfulldays

  url: "https://github.com/alibaba/flutter_boost.git"
  ref: "v3.0-preview.9"

同样遇到这个问题, 貌似还没有修复

lingjianglin avatar Jan 15 '24 09:01 lingjianglin