-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Removed default page transitions for desktop and web platforms. #82596
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
Removed default page transitions for desktop and web platforms. #82596
Conversation
goderbauer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wondering: Does the material spec define any kind of transition for Desktop (or the web)? In other words: Is not having a transition in line with the spec?
/cc @yjbanov Is it the right thing to not have a transition on the web?
I looked, but didn't see any guidance for this. As this is an uncommon in desktop applications it seems reasonable to turn them off. As I showed above, if and app does want them it is pretty straightforward to add them to the theme data for the app. |
|
I just updated the PR based on the review comments. I switched back to just a single |
chunhtai
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM if also LGT web team
goderbauer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
Our designers tell me that full page transitions without animations make sense, so LGTM! |
yjbanov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| /// animated transition for other platforms or if the app is running on the | ||
| /// web. | ||
| const PageTransitionsTheme({ | ||
| Map<TargetPlatform, PageTransitionsBuilder> builders = kIsWeb ? _defaultWebBuilders : _defaultBuilders, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kIsWeb is true both in desktop and mobile browsers. Do we want to shut off transitions in mobile browsers too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe we do. That is the feedback I got when I asked this question on this issue. For most web apps that aren't PWAs I would think they would want consistent behavior. For apps that do want transitions, they can provide them either manually or by using the theme settings detailed above.
|
I disagree that this should be disabled for the entire web platform - many web apps would like to keep the page transitions when the user accesses the web app from a mobile browser. Could we base this decision on the platform, not the kIsWeb flag instead? |
You can get this behaviour by adding the following to their app's theme: MaterialApp(
theme: ThemeData(
pageTransitionsTheme: const PageTransitionsTheme(
builders: <TargetPlatform, PageTransitionsBuilder>{
TargetPlatform.android: FadeUpwardsPageTransitionsBuilder(),
TargetPlatform.iOS: CupertinoPageTransitionsBuilder(),
},
)
)
)Which will override the defaults for both web and mobile to use the mobile style transitions. This PR is just changing the defaults, and the feedback we got was that in general apps for the web did not want transitions by default. |
We should add that to the API docs somewhere. Maybe even on MaterialApp? |
* add `semanticsLabel` to `SelectableText` * remove unused vars * Squashed commit of the following: commit 3e687a9 Author: engine-flutter-autoroll <[email protected]> Date: Tue Sep 14 17:42:05 2021 -0400 Roll Plugins from 4a98e23 to b85edeb (2 revisions) (#90083) commit ad936b4 Author: Christopher Fujino <[email protected]> Date: Tue Sep 14 14:39:17 2021 -0700 [flutter_conductor] Support initial stable release version (#89775) commit ff5dd54 Author: Ian Hickson <[email protected]> Date: Tue Sep 14 13:02:04 2021 -0700 Mention the ToS on our README (#89765) commit 8587b60 Author: Kate Lovett <[email protected]> Date: Tue Sep 14 14:53:33 2021 -0500 Update local gold api (#90072) commit 7d368dc Author: Justin McCandless <[email protected]> Date: Tue Sep 14 12:39:19 2021 -0700 InteractiveViewer with a child of zero size (#90012) Asserts that the InteractiveViewer child can't have zero size. commit 2b4ef18 Author: Akira Aratani <[email protected]> Date: Wed Sep 15 03:30:50 2021 +0900 Fix document of the switch. (#89641) commit a2cd16b Author: Christopher Fujino <[email protected]> Date: Tue Sep 14 11:22:02 2021 -0700 use test logger, which does not allow colors (#90010) commit 0f0613c Author: Varun Sharma <[email protected]> Date: Tue Sep 14 11:17:03 2021 -0700 Add specific permissions to .github/workflows/lock.yaml (#89820) commit 2866f79 Author: Jason Simmons <[email protected]> Date: Tue Sep 14 10:46:35 2021 -0700 Initialize all bindings before starting the text_editing_action_target test suite (#90067) Fixes #90057 commit b889915 Author: Michael Thomsen <[email protected]> Date: Tue Sep 14 14:08:36 2021 +0200 Change min Dart SDK constraint to track actual version (#88743) commit 3b7adb9 Author: godofredoc <[email protected]> Date: Mon Sep 13 21:32:04 2021 -0700 Lock only issues. (#90023) commit 528f77d Author: Dan Field <[email protected]> Date: Mon Sep 13 19:10:15 2021 -0700 Opacity fix (#90017) * Make sure Opacity widgets/layers do not drop the offset commit 2470f63 Author: engine-flutter-autoroll <[email protected]> Date: Mon Sep 13 22:07:02 2021 -0400 4a98e23 [flutter_plugin_tools] Make no unit tests fatal for iOS/macOS (flutter/plugins#4341) (#90016) commit a01e473 Author: stuartmorgan <[email protected]> Date: Mon Sep 13 20:57:05 2021 -0400 Re-enable plugin analysis test (#89856) commit cdad35f Author: Aneesh Rao <[email protected]> Date: Tue Sep 14 05:17:04 2021 +0530 Fix path in example (#84707) commit 576aab0 Author: Christopher Fujino <[email protected]> Date: Mon Sep 13 15:47:03 2021 -0700 add analysis_options.yaml to dev/conductor (#90005) commit fad5e4c Author: Jason Simmons <[email protected]> Date: Mon Sep 13 13:37:07 2021 -0700 Remove a redundant test case in the flutter_tools create_test (#89872) commit 738430c Author: Darren Austin <[email protected]> Date: Mon Sep 13 13:33:48 2021 -0700 Revert "Removed default page transitions for desktop and web platforms. (#82596)" (#89997) This reverts commit 43e3197 commit 9db9256 Author: Dan Field <[email protected]> Date: Mon Sep 13 13:15:19 2021 -0700 Revert "Make sure Opacity widgets/layers do not drop the offset (#89264)" (#89999) This reverts commit 0d0f7a4. commit 00f78cf Author: keyonghan <[email protected]> Date: Mon Sep 13 13:04:01 2021 -0700 renew cirrus key (#89988) commit 826da7f Author: engine-flutter-autoroll <[email protected]> Date: Mon Sep 13 15:52:03 2021 -0400 cfc8a20 renew cirrus key (flutter/plugins#4340) (#89996) commit cd112e5 Author: Anna Gringauze <[email protected]> Date: Mon Sep 13 12:13:42 2021 -0700 Update all packages (#89797)
* Fix KeyboardManager's synthesization (#88967) This PR fixes KeyboardManager's key event synthesization logic, which were dispatching events with incorrect keys, making subsequent key events crash the app. * Revert clamping scroll simulation changes (#89885) * Revert "Removed default page transitions for desktop and web platforms. (#82596)" (#89997) This reverts commit 43e3197 * 'Update Engine revision to b3af521a050e6ef076778bcaf16e27b2521df8f8 for stable release 2.5.1' * Update dds 2.0.3 -> 2.0.4 * renew cirrus key (#89988) Co-authored-by: Tong Mu <[email protected]> Co-authored-by: Kate Lovett <[email protected]> Co-authored-by: Darren Austin <[email protected]> Co-authored-by: Christopher Fujino <[email protected]> Co-authored-by: keyonghan <[email protected]>
…r#90281) * Fix KeyboardManager's synthesization (flutter#88967) This PR fixes KeyboardManager's key event synthesization logic, which were dispatching events with incorrect keys, making subsequent key events crash the app. * Revert clamping scroll simulation changes (flutter#89885) * Revert "Removed default page transitions for desktop and web platforms. (flutter#82596)" (flutter#89997) This reverts commit 43e3197 * 'Update Engine revision to b3af521a050e6ef076778bcaf16e27b2521df8f8 for stable release 2.5.1' * Update dds 2.0.3 -> 2.0.4 * renew cirrus key (flutter#89988) Co-authored-by: Tong Mu <[email protected]> Co-authored-by: Kate Lovett <[email protected]> Co-authored-by: Darren Austin <[email protected]> Co-authored-by: Christopher Fujino <[email protected]> Co-authored-by: keyonghan <[email protected]>
…r#90281) * Fix KeyboardManager's synthesization (flutter#88967) This PR fixes KeyboardManager's key event synthesization logic, which were dispatching events with incorrect keys, making subsequent key events crash the app. * Revert clamping scroll simulation changes (flutter#89885) * Revert "Removed default page transitions for desktop and web platforms. (flutter#82596)" (flutter#89997) This reverts commit 43e3197 * 'Update Engine revision to b3af521a050e6ef076778bcaf16e27b2521df8f8 for stable release 2.5.1' * Update dds 2.0.3 -> 2.0.4 * renew cirrus key (flutter#89988) Co-authored-by: Tong Mu <[email protected]> Co-authored-by: Kate Lovett <[email protected]> Co-authored-by: Darren Austin <[email protected]> Co-authored-by: Christopher Fujino <[email protected]> Co-authored-by: keyonghan <[email protected]>

The current default page transitions defined for desktop and web platforms use existing slide-up or fade transitions used on Android and iOS. As page transitions like this are not the norm for desktops or web, this PR changes the defaults to only have transitions for the mobile platforms and shuts them off for everything else including web running on anything.
This doesn't appear to be a breaking change as I tested it against the community tests and our internal tests. However, if you need to restore the previous defaults, you can add this to your app's theme:
Fixes: #82053
I updated several tests to ensure the right transitions are getting picked up, as well as removed
macOSfrom several tests and turned some off when running on the web, as transitions were no longer the default in those configurations.Pre-launch Checklist
///).