Predictive back support for root routes#120385
Predictive back support for root routes#120385auto-submit[bot] merged 169 commits intoflutter:masterfrom
Conversation
… stack has multiple routes
…nfra and replacing it with ahead-of-time
2e3afaa to
998a251
Compare
7939a36 to
a391efa
Compare
chunhtai
left a comment
There was a problem hiding this comment.
For some reason I forgot to send out the last comments, sorry about that.
| /// | ||
| /// Acts as a ChangeNotifier and notifies after its List of _RouteEntries is | ||
| /// mutated. | ||
| class _History extends Iterable<_RouteEntry> with ChangeNotifier implements Iterator<_RouteEntry> { |
There was a problem hiding this comment.
What is using Iterator API?
There was a problem hiding this comment.
I just tried it and I think I can get away without implementing Iterator. I'll open a new PR for that.
| _rawNextPagelessRestorationScopeId.dispose(); | ||
| _serializableHistory.dispose(); | ||
| userGestureInProgressNotifier.dispose(); | ||
| _history.removeListener(_handleHistoryChanged); |
There was a problem hiding this comment.
I assume some where in the dispose should send out the NavigatorNotification to change canPop to false?
There was a problem hiding this comment.
This seemed to work without needing to send a final NavigatorNotification per the thread above (#120385 (comment)). I think the routes are removed from _history before this and notifications are sent there.
flutter/flutter@2ba9f7b...ad0aa8d 2023-08-07 [email protected] Roll Flutter Engine from b10891e0d8d8 to 5b47c0577060 (1 revision) (flutter/flutter#132040) 2023-08-07 [email protected] Roll Flutter Engine from 4304d6180264 to b10891e0d8d8 (1 revision) (flutter/flutter#132037) 2023-08-07 [email protected] Roll Flutter Engine from eb91441398a1 to 4304d6180264 (1 revision) (flutter/flutter#132031) 2023-08-07 [email protected] Constrain _RenderScaledInlineWidget child size in computeDryLayout (flutter/flutter#131765) 2023-08-07 [email protected] Roll Flutter Engine from 15b5707af406 to eb91441398a1 (1 revision) (flutter/flutter#132025) 2023-08-07 [email protected] Roll Flutter Engine from a1d513f78bbb to 15b5707af406 (2 revisions) (flutter/flutter#132020) 2023-08-06 [email protected] Roll Flutter Engine from c9bd380ccbb0 to a1d513f78bbb (1 revision) (flutter/flutter#132015) 2023-08-06 [email protected] Roll Flutter Engine from 060c95f94364 to c9bd380ccbb0 (1 revision) (flutter/flutter#132008) 2023-08-06 [email protected] Roll Flutter Engine from af7aaae2f1f9 to 060c95f94364 (1 revision) (flutter/flutter#132006) 2023-08-06 [email protected] Roll Flutter Engine from cdafc05a7217 to af7aaae2f1f9 (2 revisions) (flutter/flutter#132004) 2023-08-05 [email protected] Roll Flutter Engine from b512df490c94 to cdafc05a7217 (1 revision) (flutter/flutter#131996) 2023-08-05 [email protected] Take paint offset into account for inline children hit test in Editable (flutter/flutter#131675) 2023-08-05 [email protected] Roll Flutter Engine from d26b8c8fb60c to b512df490c94 (1 revision) (flutter/flutter#131987) 2023-08-05 [email protected] Roll Flutter Engine from 2ce2913acbe4 to d26b8c8fb60c (1 revision) (flutter/flutter#131986) 2023-08-05 [email protected] Roll Flutter Engine from 628b086265f2 to 2ce2913acbe4 (1 revision) (flutter/flutter#131983) 2023-08-05 [email protected] Roll Flutter Engine from 7302a678e58e to 628b086265f2 (1 revision) (flutter/flutter#131976) 2023-08-05 [email protected] Roll Flutter Engine from 138a1ea9a692 to 7302a678e58e (2 revisions) (flutter/flutter#131975) 2023-08-05 [email protected] Roll Flutter Engine from a0d650e37f5d to 138a1ea9a692 (2 revisions) (flutter/flutter#131972) 2023-08-05 [email protected] Add TODO to refactor error handling. (flutter/flutter#131878) 2023-08-05 [email protected] Manual roll Flutter Engine from 4f4734cd48da to a0d650e37f5d (3 revisions) (flutter/flutter#131967) 2023-08-05 [email protected] Mark the ci_yaml roller task so that it is not backfilled. (flutter/flutter#131966) 2023-08-05 [email protected] mark linux packages_autoroller flaky because of token issue (flutter/flutter#131970) 2023-08-04 [email protected] Sped up the time to find macrobenchmarks. (flutter/flutter#131959) 2023-08-04 [email protected] Roll Flutter Engine from c254deb8fbda to 4f4734cd48da (2 revisions) (flutter/flutter#131955) 2023-08-04 [email protected] Roll Flutter Engine from a7bea8621f4b to c254deb8fbda (3 revisions) (flutter/flutter#131950) 2023-08-04 [email protected] Predictive back support for root routes (flutter/flutter#120385) 2023-08-04 [email protected] Roll Flutter Engine from e9f80bff0703 to a7bea8621f4b (3 revisions) (flutter/flutter#131948) 2023-08-04 [email protected] Roll Flutter Engine from badca1f7f8c9 to e9f80bff0703 (6 revisions) (flutter/flutter#131943) 2023-08-04 [email protected] Mention `showTimePicker` function be can be used to show dialog with the time picker in the `TimePickerDialog` docs (flutter/flutter#131932) 2023-08-04 [email protected] Check for simulator runtime in flutter doctor (flutter/flutter#131795) 2023-08-04 [email protected] Roll Packages from d00c1f9 to ce53da1 (3 revisions) (flutter/flutter#131935) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
|
This may've caused issues in new flutter app supposed to run on android 7. Issues are as below 2024-02-13 13:28:31.588 7001-7001 art pid-7001 I Rejecting re-init on previously-failed class java.lang.Class<io.flutter.embedding.android.f$a>: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/window/OnBackInvokedCallback; |
|
@parthpatel-simbiotik Can you file a new issue for that? |
This PR aims to support Android's predictive back gesture when popping the entire Flutter app. Predictive route transitions between routes inside of a Flutter app will come later.
Trying it out
If you want to try this feature yourself, here are the necessary steps:
options".
android:enableOnBackInvokedCallback="true"inandroid/app/src/main/AndroidManifest.xml (already done in the example project).
screen).
You should see the predictive back animation like in the animation above and be able to commit or cancel it.
go_router support
go_router works with predictive back out of the box because it uses a Navigator internally that dispatches NavigationNotifications!
go_router can be supported by adding a listener to the router and updating SystemNavigator.setFrameworkHandlesBack.Similar to with nested Navigators, nested go_routers is supported by using a PopScope widget.
Full example of nested go_routers
Resources
Fixes #109513
Depends on engine PR flutter/engine#39208 ✔️
Design doc: https://docs.google.com/document/d/1BGCWy1_LRrXEB6qeqTAKlk-U2CZlKJ5xI97g45U7azk/edit#
Migration guide: flutter/website#8952