-
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
buttonTheme not working #48299
Comments
Could be related #38655 |
Issue exist Code Sample
|
@psygo it's been a while since you opened this issue and I apologize for the lack of activity. If you're still interested in the topic, there's a wide-ranging proposal for updating the button widgets and their themes in #54776. The new proposal addresses the problems with overriding the default button foreground (text) or background colors. I'm going to close this issue in favor of #54776. |
Nice to know that there's active development on these basic widgets. Issue #54776 sure seems interesting. Good luck to you and the rest of the Flutter team. |
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 |
Use case
I'm trying to create a Button Material Theme for my app, but at least one attribute of
buttonTheme
is not acting the way I would expect, namelybuttonColor
.Other attributes, like
height
orshape
, take an immediate effect on all of my buttons, however,buttonColor
simply doesn't do anything, and I can't even access it as an attribute from within my app's widgets.In my
main.dart
:In one of my screens, I have a regular
FlatButton
, which does not get an alterations from tinkering thebuttonColor
. As a workaround, I have created acolorScheme
for mybuttonTheme
and then I access it within theFlatButton
:I find it strange that I can't access the
buttonTheme
'sbuttonColor
property from the button, but can access thecolorScheme
property.Why is it that in the
ButtonThemeData
documentation there are many properties in the constructor which can't be accessed later on as properties? Is this a mistake or maybe some sort of different API to what I'm used to?Proposal
The obvious proposal would be to have the
buttonColor
work as the otherThemeData
(sub)properties.However, it seems to make sense to also add a way of accessing the
buttonColor
as a property, e.g.color: Theme.of(context).buttonTheme.buttonColor
.The text was updated successfully, but these errors were encountered: