Skip to content
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

Closed
bitsydarel opened this issue Dec 1, 2019 · 7 comments
Closed

[theme] 'buttonColor' should depend from 'colorScheme' #45849

bitsydarel opened this issue Dec 1, 2019 · 7 comments
Labels
c: proposal A detailed proposal for a change to Flutter f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels.

Comments

@bitsydarel
Copy link

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:

MaterialApp(
      theme: ThemeData.from(
        colorScheme: ColorScheme.light(),
      ),
      home: Center(child: RaisedButton(onPressed: () {})),
    )

there's many places in theme_data that are dependent on the primarySwatch field, which cause nightmares between us and our designers.

@alikamal1
Copy link

do you want to override the default button color? if so, you can set buttonColor to the color you want

MaterialApp(
      theme: ThemeData.from(
        colorScheme: ColorScheme.light(),
        buttonColor:  Colors.blue  // specify the color 
      ),
      home: Center(child: RaisedButton(onPressed: () {})),
    )

@bitsydarel
Copy link
Author

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.

@bitsydarel
Copy link
Author

@alikamal1 also ThemeData.from does not accept any other parameters. The workaround would be to use the copyWith

@iapicca iapicca added f: material design flutter/packages/flutter/material repository. c: proposal A detailed proposal for a change to Flutter labels Dec 2, 2019
@iapicca iapicca changed the title RaisedButton does not use the color specified with colorScheme and it's default to grey [theme] 'buttonColor' should depend from 'colorScheme' Dec 2, 2019
@HansMuller HansMuller added the framework flutter/packages/flutter repository. See also f: labels. label Dec 4, 2019
@HansMuller
Copy link
Contributor

CC @darrenaustin

@bitsydarel
Copy link
Author

Any news on that issue ?
i think this should be labeled as fidelity because it's does not meet the material guideline

@HansMuller
Copy link
Contributor

@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.

@github-actions
Copy link

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 flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
c: proposal A detailed proposal for a change to Flutter f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels.
Projects
None yet
Development

No branches or pull requests

4 participants