Skip to content

[Bug]: Android physical back button exits the app #149

@bugrevealingbme

Description

@bugrevealingbme

Version

5.2.3

Flutter Doctor Output

--

What platforms are you seeing the problem on?

Android, iOS

What happened?

I have 2 problems.
1- If I click on the current tab, it returns to the previous tab. This problem came after an update.
2- If I go to the next page with the navbar (Navigator.push), Android's return button takes me directly out of the application. I'm using GoRouter (if I go with gorouter without navbar there is no problem, but this time there is no navbar).

Steps to reproduce

1- If I click on the current tab, it returns to the previous tab. This problem came after an update.
2- If I go to the next page with the navbar (Navigator.push), Android's return button takes me directly out of the application. I'm using GoRouter (if I go with gorouter without navbar there is no problem, but this time there is no navbar).

Code to reproduce the problem

PersistentTabView(
                  controller: persistentTabController,
                  hideNavigationBar: viewModel.splashView,
                  navBarBuilder: (p0) =>
                      buildBottomAppBar(t, context, themeData, viewModel),
                  tabs: viewModel.viewList,
                  onTabChanged: (value) {
                    viewModel.currentIndex = value;
                    viewModel.currentIndexNotify.value = value;
                  },
                  //screenTransitionAnimation: const ScreenTransitionAnimation.none(),
                  handleAndroidBackButtonPress: true,
                  resizeToAvoidBottomInset: false,
                )

making handleAndroidBackButtonPress false will not solve the problem. This time my function to click on the same tab is not working.

Relevant log output

No response

Screenshots

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions