admin管理员组文章数量:1289845
I am using Popscope
on my local authview- a screen where user enters a pin to enter the app. When user hit backbutton it is clearing the entered pin but does not close the app. It is the first screen when user opens the app. When I set canPop
parameter to true it will close app without clearing entered pin. I want to clear the entered pin if user entered something and close the app when hit back button
I am using Popscope
on my local authview- a screen where user enters a pin to enter the app. When user hit backbutton it is clearing the entered pin but does not close the app. It is the first screen when user opens the app. When I set canPop
parameter to true it will close app without clearing entered pin. I want to clear the entered pin if user entered something and close the app when hit back button
- avoid adding screenshot of code meta.stackoverflow/questions/303812/… – Munsif Ali Commented Feb 20 at 5:24
- Got it .Thanks for your suggestion. – Vinaya Augusthy Commented Feb 20 at 10:14
1 Answer
Reset to default 3You can assign false
to canPop
and exit the app with SystemNavigator
like this:
return PopScope(
canPop: false,
onPopInvokedWithResult: (didPop, result) {
if (didPop) return;
vm.clearPassCodeView();
SystemNavigator.pop();
},
child: YourScffold(),
);
本文标签: dartFlutter PopScope onPopInvokedWithResult not calling on pressing back buttonStack Overflow
版权声明:本文标题:dart - Flutter PopScope onPopInvokedWithResult not calling on pressing back button - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741458044a2379871.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论