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
[Material] Use primary color for selected rows and checkboxes in DataTable #67919
[Material] Use primary color for selected rows and checkboxes in DataTable #67919
Conversation
The white on green in the dark theme checkbox is hard to discern. Is there an option to change the check mark color to something darker when the background color is brighter? |
I agree that the white color on green is a bit hard to see, but currently there is no theme for Checkboxes: flutter.dev/go/material-theme-system-updates Related issue: #53420 |
return (Theme.of(context)!.brightness == Brightness.light) ? | ||
_grey100Opacity : _grey300Opacity; | ||
} | ||
if (states.contains(MaterialState.selected)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: you can change this into a ternary operator
boolean ? exp1 : exp2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Description
Light Theme
According to Material specs we should use the 8% overlay color (https://material.io/design/interaction/states.html#selected) for selected states:
Dark Theme
In a dark theme, states should use the same overlay values as their default (or light) theme (https://material.io/design/color/dark-theme.html#states).
Screenshots
Related Issues
Closes #64314
Tests
I added the following tests:
Checklist
Before you create this PR, confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]
). This will ensure a smooth and quick review process.///
).flutter analyze --flutter-repo
) does not report any problems on my PR.Breaking Change
Did any tests fail when you ran them? Please read Handling breaking changes.