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

change ThemeData.primaryColor to PrimarySwatch instead of PrimarySwatch[500] #15265

Merged
merged 2 commits into from Mar 14, 2018

Conversation

Projects
None yet
4 participants
@jonahwilliams
Copy link
Contributor

commented Mar 7, 2018

Currently, ThemeData always chooses PrimarySwatch[500] as the primary color for light themes, since this is the case for all included MaterialColors. MaterialColor and ColorSwatch also implement Color, specifically the primary color. This color can be used directly in place of the 500 shade.

Even for the same color value a MaterialColor != Color, so this change might cause breakages in any tests which assert a primary color is equal to a Color.shade500.

Fixes #14498

@googlebot googlebot added the cla: yes label Mar 7, 2018

@Hixie

This comment has been minimized.

Copy link
Contributor

commented Mar 8, 2018

LGTM, but travis is angry.

@jonahwilliams

This comment has been minimized.

Copy link
Contributor Author

commented Mar 8, 2018

Darn, missed one. I'll hold off on this for now and plan it as a breaking change with showDialog

@jonahwilliams

This comment has been minimized.

Copy link
Contributor Author

commented Mar 10, 2018

Waiting until monday for this

@jonahwilliams jonahwilliams merged commit 9a8b460 into flutter:master Mar 14, 2018

4 checks passed

cla/google All necessary CLAs are signed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
flutter-build

@jonahwilliams jonahwilliams deleted the jonahwilliams:default_primary_color branch Mar 14, 2018

@namiwang

This comment has been minimized.

Copy link

commented Mar 16, 2018

FYI. Such property is not shown in the properties section in the docs.

ref: https://docs.flutter.io/flutter/material/ThemeData-class.html

@jonahwilliams

This comment has been minimized.

Copy link
Contributor Author

commented Mar 16, 2018

@namiwang you're correct that there is no .primaryColor. In this case, the material color is itself the color - see

class ColorSwatch<T> extends Color {

DaveShuckerow pushed a commit to DaveShuckerow/flutter that referenced this pull request May 14, 2018

change ThemeData.primaryColor to PrimarySwatch instead of PrimarySwat…
…ch[500] (flutter#15265)

* change ThemeData.primaryColor to PrimarySwatch instead of PrimarySwatch[500]

* fix mismatched color in stock test case

mravn pushed a commit to mravn/flutter-wiki that referenced this pull request Sep 27, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.