Skip to content

3.0版本 WillPopScope监听页面返回时如何返回result #1034

Open
@cnting

Description

@cnting

使用WillPopScope监听点击返回键,该怎么将result返回,我用下面这个方式会陷入死循环

  return WillPopScope(
      child: child,
      onWillPop: () {
        print('===>onWillPop');
        BoostNavigator.of().pop({"sync": true});
        return Future.value(true);
      });

能否将源码中的_pendingResult[uniqueId].complete(result);暴露出来?有点类似Android中的 Activity#setResult()

flutter_boost分支:v3.0-hotfixes

Metadata

Metadata

Assignees

Labels

Boost3.0The problem in boost 3.0

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions