fixes(mobile) back navigation issue on android (#841)

This commit is contained in:
Zeeshan Khan 2022-10-21 13:05:44 -05:00 committed by GitHub
parent 95d8f60389
commit 0309b47515
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -24,15 +24,13 @@ class TabControllerPage extends ConsumerWidget {
final appRouter = AutoRouter.of(context);
return WillPopScope(
onWillPop: () async {
if (tabsRouter.activeIndex == 0) {
if (!appRouter.canNavigateBack) {
appRouter.navigateBack();
}
return appRouter.canNavigateBack;
} else {
bool atHomeTab = tabsRouter.activeIndex == 0;
if (!atHomeTab) {
tabsRouter.setActiveIndex(0);
} else {
appRouter.navigateBack();
}
return false;
return atHomeTab;
},
child: Scaffold(
body: FadeTransition(