Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

有办法屏蔽点击返回事件吗? #92

Open
oshiwei opened this issue Apr 13, 2022 · 0 comments
Open

有办法屏蔽点击返回事件吗? #92

oshiwei opened this issue Apr 13, 2022 · 0 comments

Comments

@oshiwei
Copy link

oshiwei commented Apr 13, 2022

var w = WillPopScope(
    child: Listener(
      behavior: HitTestBehavior.opaque,
      child: Center(
        child: Container(
            decoration: BoxDecoration(
              borderRadius: BorderRadius.circular(5),
              color: Colors.black.withOpacity(0.7),
            ),
            padding: const EdgeInsets.all(20),
            child: CircularProgressIndicator(
              valueColor: AlwaysStoppedAnimation(Colors.white),
            )),
      ),
    ),
    onWillPop: () async {
      print("onWillPop");
      return false;
    },
  );
showToastWidget(w, duration: Duration.zero, handleTouch: true);

需要屏蔽安卓点击物理返回键事件,这样写监听不到,有没有什么办法?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant