Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android Predictive Back Support #4580

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

syleishere
Copy link
Contributor

@syleishere syleishere commented Dec 16, 2024

Description

https://docs.flutter.dev/release/breaking-changes/android-predictive-back

Without Predictive back support, the Google TV Streamer Flet app will just crash hitting back button on remote, a much better way to do this is confirm with user they want to exit app by simply telling them to hit the back button again with a simple snackbar message, and kill Flet app at that point. This will be default disabled, but anyone can enable it in their app with 2 new page variables, making it a nice addition to control back button behavior.

Test Code

page.back_exit_enabled = True
page.back_exit_message = f"Press back again to exit"

Type of change

  • [ x ] New feature (non-breaking change which adds functionality)
  • [ x ] This change requires a documentation update

Checklist

  • [ x ] I signed the CLA.
  • [ x ] My code follows the style guidelines of this project
  • [ x ] I have performed a self-review of my own code
  • [ x ] I have commented my code, particularly in hard-to-understand areas
  • [ x ] My changes generate no new warnings
  • [ x ] New and existing tests pass locally with my changes
  • I have made corresponding changes to the documentation (if applicable)

Additional details

Solves another Google TV issue.

Summary by Sourcery

Implement Android predictive back support to prevent app crashes on Google TV when using the back button. Introduce new page variables to enable and customize back button behavior, allowing users to confirm app exit with a snackbar message.

New Features:

  • Introduce Android predictive back support to enhance user experience by allowing users to confirm app exit with a snackbar message.

Enhancements:

  • Add new page variables 'back_exit_enabled' and 'back_exit_message' to control back button behavior, providing flexibility for app developers.

Documentation:

  • Update documentation to reflect the new feature of Android predictive back support and the associated page variables.

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.

1 participant