Replace WillPopScope to PopScope

(cherry picked from commit 0c610bd08916fc91273994e1a961247432b58e75)
This commit is contained in:
dab246
2023-12-05 01:44:31 +07:00
committed by Dat H. Pham
parent 3b1df9e3b6
commit 49830df0e7
3 changed files with 18 additions and 10 deletions
@@ -34,11 +34,9 @@ class MobileContainerView extends StatelessWidget {
@override
Widget build(BuildContext context) {
return WillPopScope(
onWillPop: () async {
onCloseViewAction.call();
return false;
},
return PopScope(
onPopInvoked: (didPop) => !didPop ? onCloseViewAction : null,
canPop: false,
child: GestureDetector(
onTap: onClearFocusAction,
child: Scaffold(
@@ -31,11 +31,9 @@ class TabletContainerView extends StatelessWidget {
@override
Widget build(BuildContext context) {
return WillPopScope(
onWillPop: () async {
onCloseViewAction.call();
return false;
},
return PopScope(
onPopInvoked: (didPop) => !didPop ? onCloseViewAction : null,
canPop: false,
child: GestureDetector(
onTap: onClearFocusAction,
child: Scaffold(