Improve CupertinoRadio fidelity#149703
Conversation
803e4ef to
5846899
Compare
Co-authored-by: Kate Lovett <[email protected]>
|
Golden file changes have been found for this pull request. Click here to view and triage (e.g. because this is an intentional change). If you are still iterating on this change and are not ready to resolve the images on the Flutter Gold dashboard, consider marking this PR as a draft pull request above. You will still be able to view image results on the dashboard, commenting will be silenced, and the check will not try to resolve itself until marked ready for review. For more guidance, visit Writing a golden file test for Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
|
Golden file changes are available for triage from new commit, Click here to view. For more guidance, visit Writing a golden file test for Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
justinmc
left a comment
There was a problem hiding this comment.
Thanks for all of the great screenshots in the description! LGTM 👍
| final Paint outerPaint = Paint() | ||
| // In dark mode, the outer color of an active radio is slightly darker. | ||
| ..color = isActive | ||
| ? (isDefaultSelected && brightness == Brightness.dark ? _kDarkModeOuterColor : activeColor) |
There was a problem hiding this comment.
The logic around isDefaultSelected feels pretty weird to me. For example, if the fillColor is customized, then suddenly the active outer color in dark mode changes from _kDarkModeOuterColor to activeColor, which is very surprising.
Is there a reason why a more solid way isn't feasible? For example, can we make the active color a CupertinoDynamicColor?
There was a problem hiding this comment.
Yes. That's very true. I've refactored to do this outside the painter instead, using CupertinoDynamicColor to resolve the default dark mode color. Thanks for pointing this out.
|
Golden file changes are available for triage from new commit, Click here to view. For more guidance, visit Writing a golden file test for Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
Adds the following:
CupertinoRadiois focusable and has correct focus colorsCupertinoRadiouses correct default active/inactive/fill colorsLight mode (with focus highlight)
Dark mode
Disabled light mode
Disabled dark mode
CupertinoRadiois missing a tristate/mixed state, but Apple's latest HIG specs discourages its use.Fixes #151994
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.