Skip to content
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

Support Material 3 motion - Transitions #116526

Open
2 tasks
Tracked by #91605
guidezpl opened this issue Dec 5, 2022 · 16 comments
Open
2 tasks
Tracked by #91605

Support Material 3 motion - Transitions #116526

guidezpl opened this issue Dec 5, 2022 · 16 comments
Labels
customer: crowd Affects or could affect many people, though not necessarily a specific customer. f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. P2 Important issues not at the top of the work list team-design Owned by Design Languages team triaged-design Triaged by Design Languages team

Comments

@guidezpl
Copy link
Member

guidezpl commented Dec 5, 2022

https://m3.material.io/styles/motion/transitions/transition-patterns

There are now six common transition patterns:

  • Container transform
  • Forward and backward
  • Lateral
  • Top level
  • Enter and exit
  • Skeleton loaders

This work includes:

  • making all of these available and to spec in the animations package
  • ensuring framework transitions use these transitions rather than hardcoded defaults
@guidezpl guidezpl added f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. labels Dec 5, 2022
@florian-obernberger
Copy link

Will this also include the page transition mentioned in #110664?

And does anyone know where the specifications for this transition are?

@guidezpl
Copy link
Member Author

guidezpl commented Feb 8, 2023

Yes, but that'll be in framework rather than the animations package. Re the spec, I don't know

@masreplay
Copy link

What about the skeleton loaders?

@guidezpl
Copy link
Member Author

guidezpl commented Feb 9, 2023

What about the skeleton loaders?

There are many packages on pub that do support this. Since the guidelines don't specify a specific kind of loader, I don't think we'll add support for them in the framework yet.

@HansMuller
Copy link
Contributor

CC @justinmc

@justinmc
Copy link
Contributor

justinmc commented Feb 10, 2023

It looks like some of these transitions are also affected by the predictive back feature. I'm going to make sure we have a good way to respond to those back gestures and will keep in mind they need to support these kinds of animations.

I previously had a video of a predictive back version of one of these transitions here, but I think it's not yet finalized, so I've removed it. Googlers can get in touch with me for the details, and I'll try to update this when there is a final public version.

@dhushyanth-s
Copy link

I think this issue should be updated to reflect the fact that some of the transitions listed above are already available in the animations package and are ready to use. I was searching for a way to use Material 3 transitions in Flutter earlier this week and this issue came up pretty high on search results but was really misleading byt making my think they were not available at all in flutter.

@flutter-triage-bot flutter-triage-bot bot added multiteam-retriage-candidate team-design Owned by Design Languages team triaged-design Triaged by Design Languages team labels Jul 8, 2023
@GCSBOSS
Copy link

GCSBOSS commented Jul 21, 2023

Is this planned for the near future? A lot of Material Design value comes from motion.

@guidezpl
Copy link
Member Author

I added the curves and durations with #129942, so this issue is unblocked for any contributor.

@TahaTesser TahaTesser added the customer: crowd Affects or could affect many people, though not necessarily a specific customer. label Aug 1, 2023
@tbm98
Copy link
Contributor

tbm98 commented Nov 16, 2023

Will these features be implemented, while the main issue #91605 is closed?

@flutter-triage-bot flutter-triage-bot bot removed the triaged-design Triaged by Design Languages team label Nov 16, 2023
@flutter-triage-bot
Copy link

This issue is missing a priority label. Please set a priority label when adding the triaged-design label.

@HansMuller HansMuller added P2 Important issues not at the top of the work list triaged-design Triaged by Design Languages team labels Nov 22, 2023
@crystalarcus
Copy link

the transitions listed above are already available in the animations package and are ready to use.

@dhushyanth-s
Yes and No.
Yes, most transitions are available in animations package although, they are from previous material design and not Material 3. There is a lot of difference in some things, especially in easing and duration.
For example, the equivalent for Container Transform in the animation package is OpenContainer(),
which can be used for transition between 2 Widgets. But it takes only 1 argument for the duration, which it uses for both opening and closing animation, while Material 3 suggests using a longer duration while opening and shorter for closing.
I tried to customize it with setState, and give duration as a variable, but still, the duration is the same while opening and closing.
Guess we need a new package with Material 3 Specifications.

@guidezpl
Copy link
Member Author

Guess we need a new package with Material 3 Specifications.

Contributions to animations are welcome

@justinmc
Copy link
Contributor

I'm working on the OpenContainer transition's predictive back support here: flutter/packages#6321

I might mess with trying to match the M3 spec better if it's not a big addition to the PR, but people should feel free to open their own PR tweaking that in the meantime.

@crystalarcus
Copy link

crystalarcus commented Apr 19, 2024

I'm working on the OpenContainer transition's predictive back support here: flutter/packages#6321

@justinmc
Yesterday, I edited OpenContainer from animations package and added M3's easeInOutCubicEmphasized with 500ms duration when opening Container and Easing.EmphasizedDecelerator with 200ms duration when closing Container, and it works just find, like M3 Container transform.

We can do same with SharedAxisTransition from animations package, and to acheive Forward and Backward transitions
SharedAxisTransition in animations, see the first one, horizontal axis transition:
shared_axis_lineup
Material 3 Forward and Backward transition :

l799tk2l-10.-.Forward.and.backward.-.Button.-.3P.mp4

All we need to do is edit SharedAxisTransition and add M3's easing and durations. I will try doing it today.

@crystalarcus
Copy link

crystalarcus commented Apr 19, 2024

Yesterday, I edited OpenContainer from animations package and added M3's easeInOutCubicEmphasized with 500ms duration when opening Container and Easing.EmphasizedDecelerator with 200ms duration when closing Container, and it works just find, like M3 Container transform.

Here's a video it, it's my project Instagram Redesigned with Material 3:

Recording.2024-04-19.115013.mp4

it's seems a little laggy in video, due to low fps, but it works smooth in app.
The original OpenContainer animations were using LinearCurve and same durations for opening and closing Container. This one is using M3's Emphasized easings and different durations for open and close transitions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customer: crowd Affects or could affect many people, though not necessarily a specific customer. f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. P2 Important issues not at the top of the work list team-design Owned by Design Languages team triaged-design Triaged by Design Languages team
Projects
No open projects
Status: No status
Development

No branches or pull requests