Replace WillPopScope to PopScope
(cherry picked from commit 0c610bd08916fc91273994e1a961247432b58e75)
This commit is contained in:
@@ -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(
|
||||
|
||||
@@ -1199,6 +1199,18 @@ class ThreadController extends BaseController with EmailActionController {
|
||||
return DismissDirection.startToEnd;
|
||||
}
|
||||
|
||||
bool get inboxMailboxSelected => mailboxDashBoardController.selectedMailbox.value?.isInbox == true;
|
||||
|
||||
bool get systemBackGesturesEnable => inboxMailboxSelected && !mailboxDashBoardController.isDrawerOpen;
|
||||
|
||||
void backButtonPressedCallbackAction(BuildContext context) {
|
||||
if (mailboxDashBoardController.isDrawerOpen) {
|
||||
mailboxDashBoardController.closeMailboxMenuDrawer();
|
||||
} else {
|
||||
mailboxDashBoardController.openDefaultMailbox();
|
||||
}
|
||||
}
|
||||
|
||||
void scrollToTop() {
|
||||
if (listEmailController.hasClients) {
|
||||
listEmailController.animateTo(0, duration: const Duration(milliseconds: 500), curve: Curves.fastOutSlowIn);
|
||||
|
||||
Reference in New Issue
Block a user