gpt4 book ai didi

web - flutter 网络 : How to disable backward button of browser in flutter web application

转载 作者:行者123 更新时间:2023-12-04 10:44:41 25 4
gpt4 key购买 nike

成功登录后,用户重定向到主页,但当用户单击浏览器后退按钮时,它很容易重定向到登录屏幕。我应该怎么做才能禁用反向重定向?

最佳答案

class SecondPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
/// Hope WillPopScope will do the job for you.
return WillPopScope(
onWillPop: () async => null,
child: Scaffold(
body: Center(
child: Text('asd'),
),
),
);
}
}

关于web - flutter 网络 : How to disable backward button of browser in flutter web application,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59763779/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com