Skip to content

fix: disable predictive back gesture for tab navigators on Android#2741

Open
HaonRekcef wants to merge 1 commit intolichess-org:mainfrom
HaonRekcef:fix-predictive-back
Open

fix: disable predictive back gesture for tab navigators on Android#2741
HaonRekcef wants to merge 1 commit intolichess-org:mainfrom
HaonRekcef:fix-predictive-back

Conversation

@HaonRekcef
Copy link
Copy Markdown
Collaborator

Currently we have the following issues on newer android versions with predictive back:

predictive_back_not_working_as_intended.mp4

Notice how the broadcast list and even the home tab navigation got closed too. This is related to flutter issue: flutter/flutter#152323

This PR overrides the predictive back animation for the tab navigators which appears to fix the issue.
Preview:

zoomTransition_tab_navigator.mp4

This fixes the tabs closing unintentionally, with the cost that the predictive back animation is disabled for tab navigation. Predictive back still works correctly for root navigator screens.

@veloce
Copy link
Copy Markdown
Contributor

veloce commented Mar 11, 2026

Not sure about this yet. The flutter issue is pretty old too... but have you done extensive research about it? Changing the page transition to fix the issue is not something we want to do if we can avoid it.

@HaonRekcef
Copy link
Copy Markdown
Collaborator Author

Not sure about this yet. The flutter issue is pretty old too... but have you done extensive research about it? Changing the page transition to fix the issue is not something we want to do if we can avoid it.

I agree that changing the page transition is not something we want to do. But I can still replicate the issue in the latest flutter release and there are some what recent discussions and open pr.

But having the bug isnt better imo. This is a screen recording on my real device that maybe shows the issue more clearly.

real_device.mp4

See the frames where the broadcast list closes itself.

If we can fix this just by disabling predictive back for the tab navigators, I think it is worth it.
The other approaches are likely more involved (at least I wouldn't know how to fix it yet) and probanly would mean complicating our navigation logic to patch something that Flutter should fix, not us.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants