-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Material 3 common buttons should use sparkle splash effect on Android. #101075
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
Material 3 common buttons should use sparkle splash effect on Android. #101075
Conversation
justinmc
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 ✨
I need to try this out sometime, I still haven't seen Flutter actually do the sparkle live. Exciting.
Just one potential problem with the test text, and one question:
So if I've got an app that builds to both iOS and Android that uses Material buttons on both, and I set useMaterial3 to true, it will not sparkle on iOS? Just out of curiosity, is it not possible to get iOS to sparkle even if I want to?
It is intended only for Android devices so that is why we have the defaults set up that way. I don't know enough about the implementation whether it would work on iOS. @clocksmith would know more about that. |
Also changed the default for useMaterial3 splashFactory when it isn't sparkle to ripple instead of splash.
It will currently work on any platform that uses the non-web engine (try manually setting splashFactory for theme to InkSparkle), and eventually it will also work on the CanvasKit engine! |
|
But yes, it is correct that the Material guidance is to only use on Android. I will be following up with a post on making custom ripples with the same tech |
Part of: #91605
Part of the Material 3 migration for the common buttons is to use the sparkle splash effect if running on Android. This will be handled by the full button migration in #100794, but that is delayed due to an API issue we need to resolve. In the mean time this PR just turns on the sparkle effect (#99731) for buttons when
ThemeData.useMaterial3is turned on and the platform is non-web Android.Added tests to check that the right splash factory is used for each button.
Pre-launch Checklist
///).