1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2025-06-21 17:25:16 +00:00

Add [WillPopScope] on tablet mode

This commit is contained in:
2020-05-11 18:32:58 +02:00
parent f3eda1c89d
commit 620ad0d5cf
3 changed files with 16 additions and 12 deletions

View File

@ -21,14 +21,6 @@ class _MainRouteState extends MainController {
PageInfo get defaultPage =>
PageInfo(type: PageType.NOTIFICATIONS_PAGE, child: NotificationsScreen());
/// Allows to go to previous tab
Future<bool> _willPop() async {
if (numberOfPages == 1) return true;
popPage();
return false;
}
@override
Widget build(BuildContext context) {
return Container(
@ -36,7 +28,7 @@ class _MainRouteState extends MainController {
child: SafeArea(
// Avoid OS areas
child: WillPopScope(
onWillPop: _willPop,
onWillPop: willPop,
child: Scaffold(
appBar: currentPage.hideNavBar
? null