Skip to content

How will Flutter implement Android 13's predictive back gesture? #109513

@victor-marino

Description

@victor-marino

Internal: b/242216228

Use case

According to this page, we should get our apps ready for the new predictive back gesture that will be introduced in Android 13.

However, with just a few weeks to go before the final release, I haven't seen any info on how this will be handled in Flutter apps?

I have tried the simple trick of just adding android:enableOnBackInvokedCallback="true" to my Android Manifest, which does indeed activate the new animation on my Pixel 4 running the Android 13 beta. However, because all the back gestures are now captured by the system rather than Flutter, it completely breaks Flutter's navigation system, as ALL back gestures will now send you back to your phone's home screen, rather than taking you one level up Flutter's navigation tree when appropriate.

Proposal

I'm merely asking for information here, as I've searched extensively but couldn't find anything pertaining Flutter.

Will we have to do anything to adapt our apps? Or will the Flutter team implement this at some point at framework level? If it's the latter, when can we expect this to be added? Android 13 is right around the corner.

I'm assuming this should be handled at framework level, so that Flutter automatically implements this animation when navigating inside's Flutter's own tree, and hands it over to the system when the user is already at the root of the navigation stack (so they can correctly peek at their home screen before completing the gesture).

Eager to get some info on this!

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work listc: new featureNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to Fluttercustomer: crowdAffects or could affect many people, though not necessarily a specific customer.e: OS-version specificAffects only some versions of the relevant operating systemengineflutter/engine related. See also e: labels.f: gesturesflutter/packages/flutter/gestures repository.f: material designflutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.platform-androidAndroid applications specificallyr: fixedIssue is closed as already fixed in a newer versionteam-androidOwned by Android platform team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions