-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Adjust default CupertinoCheckbox size on desktop #172502
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
Conversation
|
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. |
|
Scuba changes are pretty bad. Maybe we can add it as an optional parameter and have it stick to its current default. |
|
This pull request has been changed to a draft. The currently pending flutter-gold status will not be able to resolve until a new commit is pushed or the change is marked ready for review again. 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. |
|
This is tricky because if we expose the tapTargetSize, there is weird behavior if they supply a size <18px:
The solutions I think could work here are:
Which of these should we proceed with @MitchellGoodwin? |
|
My vote is for
Besides visual appearance changes, tap targets are in the realm of accessibility so I'm a little nervous to make breaking changes when it comes to that. Also, rather than 18x18, it might make sense to make the minimum 14x14. 18 is the width of the radio, 14 is the width of the checkbox. I don't know if we need to enforce having a tap target bigger than the checkbox. Right now the width of the checkbox is set by a static value. I think the min TapTargetSize and the width should point to the same value. I think we can merge this in and then consider a breaking change after. I think we might want to consider having tapTargetSize default to it's current value on mobile, and to a lower default on all other platforms. That makes the most sense to me, but would be breaking on desktop and web. |
That's an option I didn't consider. And might help with the google tests as well. Plus, it means we don't have to increase the API surface. |
|
Another thing to consider is that it's common to adjust the size of the checkbox with Transform.scale, so whatever we do we need to make sure it works as expected with that. |
| TargetPlatform.fuchsia => const Size.square(kMinInteractiveDimensionCupertino), | ||
| TargetPlatform.macOS || | ||
| TargetPlatform.linux || | ||
| TargetPlatform.windows => const Size.square(CupertinoCheckbox.width), |
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.
CupertinoCheckbox.width is 14 while the size tested in the original issue is 18, which looks pretty good. Will 14 be too small?
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.
No, I think the issue has 18px because of the default macOS padding. But it's probably best to leave any additional padding customizations to the user.
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.
I think a better way is to expose a size property that applies the platform-dependent default size in this PR. What do you think?
It gets weird because the size here doesn't actually affect the size of the checkbox, just the area that, when tapped, toggles the checkbox. |
dkwingsmt
left a comment
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, thank you
MitchellGoodwin
left a comment
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 with one nit on the documentation
| /// ([CupertinoSwitch] in Flutter) instead, or to find a creative custom | ||
| /// solution. | ||
| /// | ||
| /// The checkbox has a default size of 14-by-14 pixels on desktop devices and |
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: I think this should clarify that the size difference is only the tap target area and layout padding. The actual visual checkbox itself is 14-by-14 on all platforms with this change.
flutter/flutter@a082096...5a6a1bf 2025-09-11 [email protected] Roll Dart SDK from 42045594dbc6 to f7d6a4732ab0 (2 revisions) (flutter/flutter#175222) 2025-09-11 [email protected] Roll Skia from 00c8b3f69de9 to ead9277819fc (2 revisions) (flutter/flutter#175221) 2025-09-11 [email protected] Roll Skia from 4a8817a48b25 to 00c8b3f69de9 (3 revisions) (flutter/flutter#175213) 2025-09-11 [email protected] Roll Fuchsia Linux SDK from 10x-JGF5zuuW8ik4K... to 1pTB3J5rn4YYugylf... (flutter/flutter#175210) 2025-09-11 [email protected] Roll Dart SDK from 1de2289e49fe to 42045594dbc6 (1 revision) (flutter/flutter#175203) 2025-09-10 [email protected] Roll Skia from cbb0388767d2 to 4a8817a48b25 (4 revisions) (flutter/flutter#175202) 2025-09-10 [email protected] Roll Skia from 55c9d697da52 to cbb0388767d2 (7 revisions) (flutter/flutter#175197) 2025-09-10 [email protected] Roll Dart SDK from f446144fb7c9 to 1de2289e49fe (3 revisions) (flutter/flutter#175192) 2025-09-10 [email protected] Roll Skia from c3a3d1e47699 to 55c9d697da52 (4 revisions) (flutter/flutter#175190) 2025-09-10 [email protected] Roll Packages from 2d651b2 to 03598e7 (5 revisions) (flutter/flutter#175185) 2025-09-10 [email protected] Roll Skia from 36f3c3fbec19 to c3a3d1e47699 (2 revisions) (flutter/flutter#175181) 2025-09-10 [email protected] Marks Linux plugin_test_android_standard to be unflaky (flutter/flutter#175163) 2025-09-10 [email protected] Roll Skia from 97497ee065e4 to 36f3c3fbec19 (5 revisions) (flutter/flutter#175178) 2025-09-10 [email protected] Marks Windows plugin_test_android_variants to be unflaky (flutter/flutter#175167) 2025-09-10 [email protected] Marks Linux plugin_test_android_variants to be unflaky (flutter/flutter#175162) 2025-09-10 [email protected] Marks Windows plugin_test_android_standard to be unflaky (flutter/flutter#175168) 2025-09-10 [email protected] Marks Mac plugin_test_android_standard to be unflaky (flutter/flutter#175166) 2025-09-10 [email protected] Marks Mac plugin_test_android_variants to be unflaky (flutter/flutter#175165) 2025-09-10 [email protected] [shell] Fix engineId not being set after hot restart (flutter/flutter#174451) 2025-09-10 [email protected] Roll Skia from 6acb8b29b60e to 97497ee065e4 (1 revision) (flutter/flutter#175152) 2025-09-10 [email protected] Roll Skia from 127786500ad0 to 6acb8b29b60e (1 revision) (flutter/flutter#175148) 2025-09-10 [email protected] Roll Skia from 04513dfdf517 to 127786500ad0 (2 revisions) (flutter/flutter#175145) 2025-09-09 [email protected] Roll Fuchsia Linux SDK from m7Qmvj5wtfPlMA8i8... to 10x-JGF5zuuW8ik4K... (flutter/flutter#175140) 2025-09-09 [email protected] Roll Skia from 416b3b42ece2 to 04513dfdf517 (5 revisions) (flutter/flutter#175137) 2025-09-09 [email protected] Roll Skia from 19ba56dde579 to 416b3b42ece2 (1 revision) (flutter/flutter#175134) 2025-09-09 [email protected] Adjust default CupertinoCheckbox size on desktop (flutter/flutter#172502) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC [email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Fixes [CupertinoCheckbox padding on MacOS is excessive, is applying iOS standards](flutter#165140)
Fixes [CupertinoCheckbox padding on MacOS is excessive, is applying iOS standards](flutter#165140)
Fixes [CupertinoCheckbox padding on MacOS is excessive, is applying iOS standards](flutter#165140)
Introduces a 'spacing' property to CupertinoCheckbox for customizing the space between the checkbox and its label. Updates Dart and Python implementations, integration tests, and golden images to reflect this change. Also refactors test cases for improved clarity and coverage. Flutter change: flutter/flutter#172502
* Update Flutter version to 3.38.2 and dependencies Bumped the required Flutter version to 3.38.2 in .fvmrc and build.py. Updated several Dart dependencies in pubspec.lock and removed path_provider_foundation from macOS plugin registration to reflect dependency changes. * Update ci.yml * Update Flutter cache key format in CI workflow Revised the cache-key and pub-cache-key formats in the CI workflow to use placeholders (:os:, :channel:, :version:, :hash:) instead of GitHub Actions variables. This may improve cache management and compatibility with the flutter-fvm-config-action. * Update Flutter cache keys to include architecture Modified cache-key and pub-cache-key in CI and macOS integration workflows to include architecture. This improves cache granularity and prevents issues when running workflows on different architectures. * Disable cache in Flutter FVM setup actions Set 'cache' to false in the flutter-fvm-config-action setup steps for both CI and macOS integration test workflows. This change disables caching to potentially resolve issues related to cache usage or improve workflow reliability. * Add Flutter caching to CI workflows Introduces a cache step for Flutter in both CI and macOS integration test workflows using actions/cache. This improves build performance by reusing Flutter dependencies between runs. * Add step to print Flutter cache outputs in CI Introduces a step in both CI and macOS integration test workflows to print the Flutter cache path and key outputs. This aids in debugging and verifying cache configuration during workflow runs. * Update Flutter setup in CI workflows Replaces kuhnroyal/flutter-fvm-config-action/setup with subosito/flutter-action for Flutter setup in both ci.yml and macos-integration-tests.yml. Adds a separate step to configure Flutter version using .fvmrc and removes printing of Flutter outputs. * Add spacing option to CupertinoCheckbox label Introduces a 'spacing' property to CupertinoCheckbox for customizing the space between the checkbox and its label. Updates Dart and Python implementations, integration tests, and golden images to reflect this change. Also refactors test cases for improved clarity and coverage. Flutter change: flutter/flutter#172502 * Update golden images for macOS material tests Refreshed golden images for submenu button and time picker integration tests on macOS to reflect recent UI or rendering changes. * Improve mouse gesture handling in FlutterWidgetTester Introduces proper mouse pointer exit before tap, long press, and text entry actions to avoid lingering gestures. Updates mouse hover logic to manage gesture lifecycle. Also updates navigation bar test destinations and golden images for macOS time picker and navigation bar. * Update dropdown theme_1.png golden image Replaces the macOS dropdown theme_1.png golden image in integration tests to reflect updated visual output or design changes. * Update golden image for macOS menu bar test Replaces the menu_bar_basic_open.png golden image used in integration tests for the macOS menu bar control. This ensures test accuracy with the latest UI changes. * Remove unnecessary mouse exit calls in FlutterWidgetTester Eliminated redundant _mouseExit() calls before tap, longPress, and enterText actions in FlutterWidgetTester to streamline test interactions. Also updated golden image for navigation bar theme on macOS. * Add 'persist' option to SnackBar control Introduces a 'persist' property to the SnackBar control in Dart and Python, allowing developers to specify whether the snack bar should remain visible after the timeout. Updates documentation and example usage to reflect the new option. Breaking change: https://docs.flutter.dev/release/breaking-changes/snackbar-with-action-behavior-update * Make spacing property optional in CupertinoCheckbox Changed the type of the spacing property from Number to Optional[Number] in CupertinoCheckbox to allow for None values and improve flexibility.
…ied/intelligent `src` prop (#5817) * initial commit * update examples * tests * `enable_merge_paths=False` by default * improve URL and file path handling in image resolution * `Slider`: pass value to change event * Refactor image source handling in controls and improve image provider methods * more tests * Fix image source parameter in canvas test * fix #5615: Refactor DashedStrokePattern validation and improve segments handling * Add tip for scrollable content in bottom sheet documentation * Refactor asset source resolution and minor code cleanup Replaced ResolvedAssetSource.from(...get('src')) with getSrc('src') in audio and lottie Dart files for improved asset source resolution. Cleaned up argument formatting and improved readability in lottie.dart. Updated brush.py to use src_bytes instead of src for file saving. Removed unused page argument and debug print statements from image_switch_buffered.py. * Upgrade to Flutter 3.38.2 (#5851) * Update Flutter version to 3.38.2 and dependencies Bumped the required Flutter version to 3.38.2 in .fvmrc and build.py. Updated several Dart dependencies in pubspec.lock and removed path_provider_foundation from macOS plugin registration to reflect dependency changes. * Update ci.yml * Update Flutter cache key format in CI workflow Revised the cache-key and pub-cache-key formats in the CI workflow to use placeholders (:os:, :channel:, :version:, :hash:) instead of GitHub Actions variables. This may improve cache management and compatibility with the flutter-fvm-config-action. * Update Flutter cache keys to include architecture Modified cache-key and pub-cache-key in CI and macOS integration workflows to include architecture. This improves cache granularity and prevents issues when running workflows on different architectures. * Disable cache in Flutter FVM setup actions Set 'cache' to false in the flutter-fvm-config-action setup steps for both CI and macOS integration test workflows. This change disables caching to potentially resolve issues related to cache usage or improve workflow reliability. * Add Flutter caching to CI workflows Introduces a cache step for Flutter in both CI and macOS integration test workflows using actions/cache. This improves build performance by reusing Flutter dependencies between runs. * Add step to print Flutter cache outputs in CI Introduces a step in both CI and macOS integration test workflows to print the Flutter cache path and key outputs. This aids in debugging and verifying cache configuration during workflow runs. * Update Flutter setup in CI workflows Replaces kuhnroyal/flutter-fvm-config-action/setup with subosito/flutter-action for Flutter setup in both ci.yml and macos-integration-tests.yml. Adds a separate step to configure Flutter version using .fvmrc and removes printing of Flutter outputs. * Add spacing option to CupertinoCheckbox label Introduces a 'spacing' property to CupertinoCheckbox for customizing the space between the checkbox and its label. Updates Dart and Python implementations, integration tests, and golden images to reflect this change. Also refactors test cases for improved clarity and coverage. Flutter change: flutter/flutter#172502 * Update golden images for macOS material tests Refreshed golden images for submenu button and time picker integration tests on macOS to reflect recent UI or rendering changes. * Improve mouse gesture handling in FlutterWidgetTester Introduces proper mouse pointer exit before tap, long press, and text entry actions to avoid lingering gestures. Updates mouse hover logic to manage gesture lifecycle. Also updates navigation bar test destinations and golden images for macOS time picker and navigation bar. * Update dropdown theme_1.png golden image Replaces the macOS dropdown theme_1.png golden image in integration tests to reflect updated visual output or design changes. * Update golden image for macOS menu bar test Replaces the menu_bar_basic_open.png golden image used in integration tests for the macOS menu bar control. This ensures test accuracy with the latest UI changes. * Remove unnecessary mouse exit calls in FlutterWidgetTester Eliminated redundant _mouseExit() calls before tap, longPress, and enterText actions in FlutterWidgetTester to streamline test interactions. Also updated golden image for navigation bar theme on macOS. * Add 'persist' option to SnackBar control Introduces a 'persist' property to the SnackBar control in Dart and Python, allowing developers to specify whether the snack bar should remain visible after the timeout. Updates documentation and example usage to reflect the new option. Breaking change: https://docs.flutter.dev/release/breaking-changes/snackbar-with-action-behavior-update * Make spacing property optional in CupertinoCheckbox Changed the type of the spacing property from Number to Optional[Number] in CupertinoCheckbox to allow for None values and improve flexibility. --------- Co-authored-by: Feodor Fitsner <[email protected]>

Fixes CupertinoCheckbox padding on MacOS is excessive, is applying iOS standards