-
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
ButtonThemeData does not define its colorScheme in the constructor #38655
Comments
Any update on the pull request ? |
I'm closing the issue since #39627 fixes this |
I'm reopening this issue since we had to revert the original PR (#42854). The existence of both ThemeData and ButtonThemeData's colorScheme makes it impossible to define a default color scheme value for ButtonTheme, since doing so will never allow the buttons to ever access ThemeData's colorScheme |
Why is that property even there? Isn't |
…lutter#39627) * Set default colorScheme for ButtonThemeData
…38655) (flutter#39627)" (flutter#42854) This reverts commit 19899db.
@Levi-Lesches [sorry about the long (long) delay in responding. You're correct that it doesn't really make sense to have a ColorScheme just for the ButtonTheme. ButtonTheme has evolved in a way that has made it rather difficult to use. We're considering simplifying the way buttons are themed. Look for a concrete proposal early next year. |
That's good to hear. Just a polite reminder that this issue is actively making #38646 much harder to work around. |
@Levi-Lesches As you may have already noticed, the long-promised proposal to remedy this problem, albeit by leaving it behind, has been published in #54776. I'm going to close this issue in favor of #54776. If you have time, I'll hope you'll consider the proposal and add your feedback. |
Checked it out, looks great! Can't wait for it to hit stable, the theming as of now really does get quite confusing. |
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 |
When initializing a new
ButtonThemeData
, thecolorScheme
property is not automatically generated, which pretty much makes all other parameters useless in some cases. For example, I'm trying to get the text color of aRaisedButton
in anAlertDialog.actions
button bar, and I need to override the theme (actually a really bad issue, IMO, see #38646). So I am trying to do:But I get an error:
Logs
I noticed this was because of
ButtonTheme.getTextColor
:This fails on
ButtonTextTheme.accent
, and since the error is thatcolorScheme
was never defined, I went to the constructor:So
colorScheme
is never actually defined if not explicitly passed in. And because of #38646, passing in any of the other parameters doesn't actually matter forAlertDialog.actions
.Output of
flutter doctor -v
:The text was updated successfully, but these errors were encountered: