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

MaterialColor canot be compared directly with Color type #69162

Closed
xu-baolin opened this issue Oct 28, 2020 · 4 comments
Closed

MaterialColor canot be compared directly with Color type #69162

xu-baolin opened this issue Oct 28, 2020 · 4 comments
Labels
f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. in triage Presently being triaged by the triage team

Comments

@xu-baolin
Copy link
Member

@shihaohong Hi,
Continue of #68171 (comment)

indicatorColor ??= accentColor == primaryColor ? Colors.white : accentColor;

I believe this should be a typo instead of accentColor.value == primaryColor.value.
Most of the time, primaryColor is MaterialColor type and accentColor is Color type. They cannot be compared directly with ==, otherwise, it will not be the expected result.

Fix this typo will break somethings, but it doesn’t seem right if you let it as-is. It’s really a tricky problem.

@pedromassangocode
Copy link

Hi @xu-baolin
Is there a practical way to prove that the current implementation is wrong?
Thank you

@pedromassangocode pedromassangocode added in triage Presently being triaged by the triage team waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds labels Oct 28, 2020
@HansMuller
Copy link
Contributor

This doesn't address this specific problem however in the fullness of time: TabBar et al should just depend on TabBarTheme, and by default it should configure itself in terms of the overall theme's ColorScheme. TabBarTheme needs to morph into a TabBarTheme/TabBarThemeData pair that matches the conventions in flutter.dev/go/material-theme-system-updates.

@shihaohong shihaohong added f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. labels Oct 31, 2020
@pedromassangocode
Copy link

Without additional information, we are unfortunately not sure how to resolve this issue.
We are therefore reluctantly going to close this bug for now.
Please don't hesitate to comment on the bug if you have any more information for us; we will reopen it right away!
Thanks for your contribution.

Could everyone who still has this problem please file a new issue with the exact description of what happens, logs, and the output of flutter doctor -v.
All system setups can be slightly different, so it's always better to open new issues and reference related issues.

@pedromassangocode pedromassangocode removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Nov 24, 2020
@github-actions
Copy link

github-actions bot commented Aug 9, 2021

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 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. in triage Presently being triaged by the triage team
Projects
None yet
Development

No branches or pull requests

4 participants