-
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
[theme] 'buttonColor' should depend from 'colorScheme' #45849
Comments
do you want to override the default button color? if so, you can set MaterialApp(
theme: ThemeData.from(
colorScheme: ColorScheme.light(),
buttonColor: Colors.blue // specify the color
),
home: Center(child: RaisedButton(onPressed: () {})),
) |
Unfortunately I’m not looking for a workaround, this is a bug because this should be done by the framework when creating a theme with colorScheme. |
@alikamal1 also ThemeData.from does not accept any other parameters. The workaround would be to use the copyWith |
Any news on that issue ? |
@bitsydarel it's been a long time 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 does bind the default button colors to the overall theme's ColorSchme, per the Material Design spec. |
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 |
Steps to Reproduce
1- Create a material app widget
2- provide it a theme with a colorscheme
3- specify the home as a raisedbutton with a onPressed callback so that it's wont be disable.
Target Platform:
All
Target OS version/browser:
All
Devices:
All
As far as i understand, RaisedButton it's the material Contained Button, so the color of the button should be the primary color.
RaisedButton color is dependent on the ThemeData.buttonColor, ThemeData.buttonColor is equal to primarySwatch[600] which is not defined when using colorScheme , this line cause problem.
code to reproduce:
there's many places in theme_data that are dependent on the primarySwatch field, which cause nightmares between us and our designers.
The text was updated successfully, but these errors were encountered: