WillPopScope在v3.0_release.1失效问题
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;
},
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
不能复现问题。
BoostNavigator.instance.pop(); 不会触发WillPopScope v3.0-null-safety-release.2.1
这个问题解决了吗。我遇到了同样的问题
url: "https://github.com/alibaba/flutter_boost.git"
ref: "v3.0-preview.9"
同样遇到这个问题, 貌似还没有修复