-
Notifications
You must be signed in to change notification settings - Fork 26.8k
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
Allow a BoxDecoration to be specified in ButtonThemeData #41627
Comments
b/141787699 |
Hi @jkurtw, we shouldn't support this type of modification since that would violate the Material specification. However, I think what you could be looking for is creating a custom button composed of a |
@shihaohong Does it "violate" the Material spec or is it unspecified by Material spec? |
I believe that modifying components to have an appearance not described in the design language is a violation of the design language. |
/cc @willlarche for your thoughts |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
Internal: b/141787699
Flutter doesn't have a good way of decorating a button with something that isn't a flat color. This is because the underlying Material widget doesn't allow for it.
Right now we just stack a DecoratedBox behind a MaterialButton with a transparent background. This works for our larger buttons, but fails for our smaller buttons, since the MaterialButton pads the height up to 48dp. This makes the button look like a regular sized button and there's no reasonable way to workaround it.
A proper fix would be to allow a BoxDecoration to be specified in ButtonThemeData. Then we can remove the Stack + DecoratedBox workaround.
Related to or same as #21125
The text was updated successfully, but these errors were encountered: