Skip to content
This repository has been archived by the owner on Jun 13, 2024. It is now read-only.

dont use TwoPanePageRoute if there is no hinge #909

Merged
merged 3 commits into from
Mar 6, 2023

Conversation

jonahwilliams
Copy link
Member

Fixes #904

See also: flutter/flutter#120937

The TwoPanePageRoute doesn't use a ModalRoute, leaving the previous route fully active. Additionally, there is no page transition on these route transitions.

lib/routes.dart Outdated
@@ -118,7 +118,8 @@ class RouteConfiguration {
/// route. Set it on the [MaterialApp.onGenerateRoute] or
/// [WidgetsApp.onGenerateRoute] to make use of the [paths] for route
/// matching.
static Route<dynamic>? onGenerateRoute(RouteSettings settings) {
static Route<dynamic>? onGenerateRoute(
RouteSettings settings, bool hasHinge) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: trailing comma

Copy link
Member

@guidezpl guidezpl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  _    ___ _____ __  __ 
 | |  / __|_   _|  \/  |
 | |_| (_ | | | | |\/| |
 |____\___| |_| |_|  |_|
                        

thanks!

@guidezpl guidezpl merged commit 861e719 into flutter:main Mar 6, 2023
@jonahwilliams jonahwilliams deleted the fix_routes branch April 19, 2023 23:40
auto-submit bot pushed a commit to flutter/engine that referenced this pull request Apr 20, 2023
Related to flutter/flutter#114402

At least in the flutter gallery test app, with flutter/gallery#909 reverted - this significantly improves the performance in the Xcode frame debugger. If we wanted to do this for more color sources or filter effects, we need to do much more work to track texture opacity, but this seems like a reasonable and low cost first step.

### Before

![image](https://user-images.githubusercontent.com/8975114/233222371-f33d29ad-c556-4db0-b949-84777bb09307.png)

### After

![image](https://user-images.githubusercontent.com/8975114/233222350-0517d109-cabd-45af-a0af-06b95da2d026.png)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Many routes are unconditionally using the foldable navigation strategy
2 participants