-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Improve CupertinoCheckbox fidelity
#151441
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
Improve CupertinoCheckbox fidelity
#151441
Conversation
| color: CupertinoColors.white, | ||
| darkColor: Color.fromARGB(255, 87, 87, 87), |
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.
| color: CupertinoColors.white, | |
| darkColor: Color.fromARGB(255, 87, 87, 87), | |
| color: CupertinoColors.white, | |
| darkColor: Color.fromARGB(255, 87, 87, 87), |
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.
Also according to my computation the dark color should not be an opaque color, but must be a gradient from a translucent white to another translucent white, otherwise it will look differently with non-black background.
| /// If this property is null, then the side defaults to a one pixel wide | ||
| /// black, solid border. |
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.
Is this "one pixel wide black, solid border" also only rendered when the checkbox's value is false?
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.
Also, why is the default value a "one pixel wide black, solid border"? A default widget should look like the native widget, but I don't see any black solid border in the native widget, even when unselected.
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.
Ah... thanks for catching this. This was the current documentation before this PR that should be updated in this PR.
Is this "one pixel wide black, solid border" also only rendered when the checkbox's value is false?
Yes. I've changed to "one pixel wide grey-black, solid border".
CupertinoCheckbox CupertinoCheckbox
Yep. Scuba failures are expected. I will proceed to merge manually irrespective of Google testing failures. |
Manual roll Flutter from 85960d2 to 4ff9462 (45 revisions) Manual roll requested by [email protected] flutter/flutter@85960d2...4ff9462 2024-08-01 [email protected] Fix local testing, gradle XML errors, and enable on CI. (flutter/flutter#152383) 2024-08-01 [email protected] Fix formatting issues in `search_anchor.0_test.dart` (flutter/flutter#152669) 2024-08-01 [email protected] Add tests for search anchor examples (flutter/flutter#152659) 2024-08-01 [email protected] Roll Flutter Engine from 4dc94d6f88ba to 7c4a44611abe (1 revision) (flutter/flutter#152665) 2024-08-01 [email protected] Roll Flutter Engine from f546fef7d7cd to 4dc94d6f88ba (1 revision) (flutter/flutter#152663) 2024-08-01 [email protected] Roll Flutter Engine from 0fbff219c498 to f546fef7d7cd (2 revisions) (flutter/flutter#152661) 2024-08-01 [email protected] Roll Flutter Engine from 32f788823f43 to 0fbff219c498 (5 revisions) (flutter/flutter#152658) 2024-08-01 [email protected] Manual roll Flutter Engine from 32f788823f43 to ed95b491f260 (3 revisions) (flutter/flutter#152654) 2024-08-01 [email protected] Manual roll Flutter Engine from 16332725788c to 32f788823f43 (11 revisions) (flutter/flutter#152648) 2024-07-31 [email protected] [CupertinoActionSheet] Make `_ActionSheetButtonBackground` stateless (flutter/flutter#152283) 2024-07-31 [email protected] Implementing null-aware logic in `/packages/flutter/` (flutter/flutter#152294) 2024-07-31 [email protected] Reintroduce verbose logging for hot reload flake (flutter/flutter#152639) 2024-07-31 [email protected] [material/menu_anchor.dart] Remove unused early key event listener (flutter/flutter#150915) 2024-07-31 [email protected] Improve `CupertinoCheckbox` fidelity (flutter/flutter#151441) 2024-07-31 [email protected] Update docs to support new Android version (flutter/flutter#152503) 2024-07-31 [email protected] [Android] Update integration test AVD dependency to use Android 35 emulators (flutter/flutter#152498) 2024-07-31 [email protected] Shift + click gesture support for SelectionArea on desktop platforms (flutter/flutter#148574) 2024-07-31 [email protected] Add ability to clip `Stepper` step content (flutter/flutter#152370) 2024-07-31 [email protected] Calendar font factor (flutter/flutter#152341) 2024-07-31 [email protected] Remove redundant usages of zones in skia_client.dart (flutter/flutter#149366) 2024-07-31 [email protected] Set up tests that verify we can build a fresh counter app across our Gradle/AGP/Kotlin support range (flutter/flutter#151568) 2024-07-31 [email protected] remove bringup from Windows tool_integration_tests_* (flutter/flutter#152599) 2024-07-31 [email protected] � : Animation controller now has ability to repeat animation 'n' no. of times. (flutter/flutter#150764) 2024-07-31 [email protected] Roll Flutter Engine from 3b31b21599d1 to 16332725788c (1 revision) (flutter/flutter#152631) 2024-07-31 [email protected] Roll Flutter Engine from b73367a30e9b to 3b31b21599d1 (8 revisions) (flutter/flutter#152625) 2024-07-31 [email protected] Roll Packages from 99e8606 to 46a712f (8 revisions) (flutter/flutter#152622) 2024-07-31 [email protected] Add tests for scaffold messenger examples (flutter/flutter#152536) 2024-07-31 [email protected] Add test for search_anchor.0.dart (flutter/flutter#152371) 2024-07-31 [email protected] Use decoration hint text as the default value for dropdown button hints (flutter/flutter#152474) 2024-07-31 [email protected] Deprecate invalid InputDecoration.collapsed parameters (flutter/flutter#152486) 2024-07-31 [email protected] increase sharding on Windows tool_integration_tests (flutter/flutter#152582) 2024-07-31 [email protected] Roll Flutter Engine from e2ece7e58480 to b73367a30e9b (4 revisions) (flutter/flutter#152592) 2024-07-31 [email protected] Roll Flutter Engine from 0b42657a184e to e2ece7e58480 (2 revisions) (flutter/flutter#152589) 2024-07-31 [email protected] Roll Flutter Engine from 08f9be3ab284 to 0b42657a184e (2 revisions) (flutter/flutter#152586) 2024-07-30 [email protected] Clarify and cleanup the test-exemption wording in tree-hygiene. (flutter/flutter#152402) 2024-07-30 [email protected] [web] Set COEP:credentialless on flutter run/drive. (flutter/flutter#152413) 2024-07-30 [email protected] Roll Flutter Engine from a4b88a37d511 to 08f9be3ab284 (5 revisions) (flutter/flutter#152583) 2024-07-30 [email protected] Marks Mac platform_channel_sample_test_macos to be flaky (flutter/flutter#151884) 2024-07-30 [email protected] Roll Flutter Engine from a6c5ff26c266 to a4b88a37d511 (2 revisions) (flutter/flutter#152575) 2024-07-30 [email protected] Reland #151599 (Add button semantics in list tile ) with a flag to control behavior. (flutter/flutter#152526) 2024-07-30 [email protected] Shift macOS/Android tests from Pixel 7 to mokey in staging (flutter/flutter#152571) 2024-07-30 [email protected] Roll Flutter Engine from 31bb9f98472a to a6c5ff26c266 (5 revisions) (flutter/flutter#152573) 2024-07-30 [email protected] Roll Packages from 247fb5f to 99e8606 (5 revisions) (flutter/flutter#152567) 2024-07-30 [email protected] Fix default avatar icon theme size for Material 2 (flutter/flutter#152307) ...
**NOTE: Previous [PR](flutter#148804) was closed because of a bad merge leading to pollution with unrelated commits.** This PR improves on the look and feel of `CupertinoCheckbox` to more closely match native iOS/macOS checkboxes. Adds the following updates from a native macOS checkbox: * Fill color of an unchecked checkbox is a linear gradient that goes from darker at the top to lighter at the bottom in dark mode * Size of box reduced from 18.0 to 14.0 * Stroke width of check reduced from 2.5 to 2.0 * Border color changed from solid black to gray black in light mode and a transparent gray in dark mode * In light mode, checkbox darkens when pressed * In dark mode, checkbox lightens when pressed * Default blue color of a checked checkbox is darker in dark mode ### Light Mode | Native macOS | Flutter Before | Flutter After | | ----------- | ----------- | ----------- | | <img width="63" alt="native checkbox" src="https://github.com/flutter/flutter/assets/77553258/d57d4c78-2e67-49fb-9491-a5acee3782a7"> | <img width="66" alt="Screenshot 2024-06-27 at 10 23 18 AM" src="https://github.com/flutter/flutter/assets/77553258/31c913ff-d36f-4eb5-b737-3a9117bd7eff"> | <img width="66" alt="Screenshot 2024-06-27 at 10 39 22 AM" src="https://github.com/flutter/flutter/assets/77553258/ace8ef29-efae-4049-8f78-13fd39851947"> | ### Dark Mode - Checked | Native macOS | Flutter Before | Flutter After | | ----------- | ----------- | ----------- | | <img width="22" alt="native light" src="https://github.com/user-attachments/assets/fc52d5e1-7ab0-4a5d-b0fa-5b5bee3ed39d"> | <img width="22" alt="flutter before light" src="https://github.com/user-attachments/assets/16e033a1-d2dd-4fb2-a5a5-f730c5f7cdc7"> | <img width="22" alt="flutter after light" src="https://github.com/user-attachments/assets/8c0cff99-930e-4f5e-8540-e64294c1b4fa"> | ### Dark Mode - Unchecked | Native macOS | Flutter Before | Flutter After | | ----------- | ----------- | ----------- | | <img width="22" alt="native dark mode" src="https://github.com/user-attachments/assets/333280a0-85db-4464-9663-03ef7eafc270"> | <img width="22" alt="flutter before dark mode" src="https://github.com/user-attachments/assets/a46e01ec-0d0b-4bb7-8d08-4b2723424a12"> | <img width="22" alt="flutter dark mode" src="https://github.com/user-attachments/assets/a70ae4ad-f1ad-4441-a416-350cbdc32679"> | ### Light Mode - Disabled | Native macOS | Flutter Before | Flutter After | | --- | --- | --- | | <img width="121" alt="native disabled checkbox" src="https://github.com/user-attachments/assets/ed050d14-efec-49dd-82b6-1e7ed7fa99f9"> | <img width="136" alt="flutter b4 disabled checkbox" src="https://github.com/user-attachments/assets/564918cf-f936-448d-b975-7bf9248bbf35"> | <img width="156" alt="flutter disabled checkbox" src="https://github.com/user-attachments/assets/82f672a7-12e8-469c-99af-9f94c959df8f"> | ### Dark Mode - Disabled | Native macOS | Flutter Before | Flutter After | | --- | --- | --- | | <img width="110" alt="disabled dark checkbox native" src="https://github.com/user-attachments/assets/02a43b3f-5619-4b05-9066-2fd43a58c956"> | <img width="136" alt="disabled dark checkbox flutter b4" src="https://github.com/user-attachments/assets/3a3db322-2002-4808-adc0-b10a7ab42381"> | <img width="140" alt="disabled dark checkbox flutter" src="https://github.com/user-attachments/assets/cb91955a-8302-4dc7-8050-221fa2a7045f"> Fixes flutter#148719. Related PR exploring these changes: flutter#147892 ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [ ] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/wiki/Tree-hygiene#overview [Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene [test-exempt]: https://github.com/flutter/flutter/wiki/Tree-hygiene#tests [Flutter Style Guide]: https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo [Features we expect every widget to implement]: https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/wiki/Chat [Data Driven Fixes]: https://github.com/flutter/flutter/wiki/Data-driven-Fixes --------- Co-authored-by: Kate Lovett <[email protected]>
**NOTE: Previous [PR](flutter#148804) was closed because of a bad merge leading to pollution with unrelated commits.** This PR improves on the look and feel of `CupertinoCheckbox` to more closely match native iOS/macOS checkboxes. Adds the following updates from a native macOS checkbox: * Fill color of an unchecked checkbox is a linear gradient that goes from darker at the top to lighter at the bottom in dark mode * Size of box reduced from 18.0 to 14.0 * Stroke width of check reduced from 2.5 to 2.0 * Border color changed from solid black to gray black in light mode and a transparent gray in dark mode * In light mode, checkbox darkens when pressed * In dark mode, checkbox lightens when pressed * Default blue color of a checked checkbox is darker in dark mode ### Light Mode | Native macOS | Flutter Before | Flutter After | | ----------- | ----------- | ----------- | | <img width="63" alt="native checkbox" src="https://github.com/flutter/flutter/assets/77553258/d57d4c78-2e67-49fb-9491-a5acee3782a7"> | <img width="66" alt="Screenshot 2024-06-27 at 10 23 18 AM" src="https://github.com/flutter/flutter/assets/77553258/31c913ff-d36f-4eb5-b737-3a9117bd7eff"> | <img width="66" alt="Screenshot 2024-06-27 at 10 39 22 AM" src="https://github.com/flutter/flutter/assets/77553258/ace8ef29-efae-4049-8f78-13fd39851947"> | ### Dark Mode - Checked | Native macOS | Flutter Before | Flutter After | | ----------- | ----------- | ----------- | | <img width="22" alt="native light" src="https://github.com/user-attachments/assets/fc52d5e1-7ab0-4a5d-b0fa-5b5bee3ed39d"> | <img width="22" alt="flutter before light" src="https://github.com/user-attachments/assets/16e033a1-d2dd-4fb2-a5a5-f730c5f7cdc7"> | <img width="22" alt="flutter after light" src="https://github.com/user-attachments/assets/8c0cff99-930e-4f5e-8540-e64294c1b4fa"> | ### Dark Mode - Unchecked | Native macOS | Flutter Before | Flutter After | | ----------- | ----------- | ----------- | | <img width="22" alt="native dark mode" src="https://github.com/user-attachments/assets/333280a0-85db-4464-9663-03ef7eafc270"> | <img width="22" alt="flutter before dark mode" src="https://github.com/user-attachments/assets/a46e01ec-0d0b-4bb7-8d08-4b2723424a12"> | <img width="22" alt="flutter dark mode" src="https://github.com/user-attachments/assets/a70ae4ad-f1ad-4441-a416-350cbdc32679"> | ### Light Mode - Disabled | Native macOS | Flutter Before | Flutter After | | --- | --- | --- | | <img width="121" alt="native disabled checkbox" src="https://github.com/user-attachments/assets/ed050d14-efec-49dd-82b6-1e7ed7fa99f9"> | <img width="136" alt="flutter b4 disabled checkbox" src="https://github.com/user-attachments/assets/564918cf-f936-448d-b975-7bf9248bbf35"> | <img width="156" alt="flutter disabled checkbox" src="https://github.com/user-attachments/assets/82f672a7-12e8-469c-99af-9f94c959df8f"> | ### Dark Mode - Disabled | Native macOS | Flutter Before | Flutter After | | --- | --- | --- | | <img width="110" alt="disabled dark checkbox native" src="https://github.com/user-attachments/assets/02a43b3f-5619-4b05-9066-2fd43a58c956"> | <img width="136" alt="disabled dark checkbox flutter b4" src="https://github.com/user-attachments/assets/3a3db322-2002-4808-adc0-b10a7ab42381"> | <img width="140" alt="disabled dark checkbox flutter" src="https://github.com/user-attachments/assets/cb91955a-8302-4dc7-8050-221fa2a7045f"> Fixes flutter#148719. Related PR exploring these changes: flutter#147892 ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [ ] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/wiki/Tree-hygiene#overview [Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene [test-exempt]: https://github.com/flutter/flutter/wiki/Tree-hygiene#tests [Flutter Style Guide]: https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo [Features we expect every widget to implement]: https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/wiki/Chat [Data Driven Fixes]: https://github.com/flutter/flutter/wiki/Data-driven-Fixes --------- Co-authored-by: Kate Lovett <[email protected]>
NOTE: Previous PR was closed because of a bad merge leading to pollution with unrelated commits.
This PR improves on the look and feel of
CupertinoCheckboxto more closely match native iOS/macOS checkboxes.Adds the following updates from a native macOS checkbox:
Light Mode
Dark Mode - Checked
Dark Mode - Unchecked
Light Mode - Disabled
Dark Mode - Disabled
Fixes #148719.
Related PR exploring these changes: #147892
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.