flutter / flutter

Flutter makes it easy and fast to build beautiful apps for mobile and beyond
https://flutter.dev
BSD 3-Clause "New" or "Revised" License
165.35k stars 27.28k forks source link

Add-to-app should support predictive back route transitions #148997

Open justinmc opened 4 months ago

justinmc commented 4 months ago

Use case

As of https://github.com/flutter/engine/pull/52302, predictive back works in Android add-to-app everywhere except within Flutter routes (predictive back route transitions was added in https://github.com/flutter/flutter/pull/141373). Add-to-app should support predictive back route transitions too.

Proposal

Support route transitions in FlutterFragment. This would be similar to how it was added for FlutterActivity in https://github.com/flutter/engine/pull/49093, but in FlutterFragment like https://github.com/flutter/engine/pull/52302, which added basic predictive back support there.

Predictive back route transitions within Flutter look like this:

https://github.com/flutter/flutter/assets/8436039/96b6dc20-89c9-45db-b8b4-aec7e996477b

How to reproduce

Run an add-to-app Flutter app where the Flutter part has multiple routes, like this: https://github.com/justinmc/flutter-add-to-app

Perform a back gesture to go from one Flutter route to another. You should be able to peek at the previous route and cancel the gesture, but instead you just get the typical ZoomPageTransition.

flutter-triage-bot[bot] commented 4 months ago

The triaged-android label is irrelevant if there is no team-android label or fyi-android label.