Skip to content

Conversation

MitchellGoodwin
Copy link
Contributor

@MitchellGoodwin MitchellGoodwin commented May 10, 2023

Fixes: #102813

Adds a checkmark style to the Cupertino Radio. Also allows the Radio.adaptive and RadioListTile.adaptive widgets to control whether they use the checkmark style for their Cupertino widgets or not.

This is how it looks in action:

Screen.Recording.2023-05-10.at.4.42.30.PM.mov

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I signed the CLA.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@flutter-dashboard flutter-dashboard bot added f: cupertino flutter/packages/flutter/cupertino repository f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. labels May 10, 2023
@MitchellGoodwin MitchellGoodwin marked this pull request as ready for review May 12, 2023 17:15
@@ -345,6 +349,14 @@ class Radio<T> extends StatefulWidget {
/// {@macro flutter.widgets.Focus.autofocus}
final bool autofocus;

/// Controls wether the checkmark style is used in an iOS style radio.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// Controls wether the checkmark style is used in an iOS style radio.
/// Controls whether the checkmark style is used in an iOS style radio.

/// Determines wether or not to use the checkbox style for the [CupertinoRadio]
/// control.
///
/// Only usuable under the [RadioListTile.adaptive] constructor. If set to
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// Only usuable under the [RadioListTile.adaptive] constructor. If set to
/// Only usable under the [RadioListTile.adaptive] constructor. If set to

@@ -129,6 +132,7 @@ class Radio<T> extends StatefulWidget {
this.visualDensity,
this.focusNode,
this.autofocus = false,
this.useAdaptiveCheckmarkStyle = false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eww. I mean, I see why this has to be here if you want to use it from the adaptive constructor, but it feels ugly to have a parameter to the adaptive constructor that is only in effect for one kind of rendering. I suppose it's no different than materialTapTargetSize in that regard, though.

Would it be better to include "cupertino" in the name to make it clear that it doesn't affect Material radio buttons? e.g. useCupertinoCheckmarkStyle?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I agree, I was trying different things to make it less gross, but this is where I landed.

Using Cupertino in the name instead of adaptive seems better to avoid possible confusion.

@MitchellGoodwin MitchellGoodwin force-pushed the create-cupertino-radio branch from 3a4260b to 1ac7557 Compare May 12, 2023 17:55
@@ -78,6 +78,7 @@ class CupertinoRadio<T> extends StatefulWidget {
this.fillColor,
this.focusColor,
this.focusNode,
this.useCheckmarkStyle = false,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: same ordering as in radio_list_tile.dart please

@@ -345,6 +349,14 @@ class Radio<T> extends StatefulWidget {
/// {@macro flutter.widgets.Focus.autofocus}
final bool autofocus;

/// Controls whether the checkmark style is used in an iOS style radio.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// Controls whether the checkmark style is used in an iOS style radio.
/// Controls whether the checkmark style is used in an iOS-style radio.

@@ -345,6 +349,14 @@ class Radio<T> extends StatefulWidget {
/// {@macro flutter.widgets.Focus.autofocus}
final bool autofocus;

/// Controls whether the checkmark style is used in an iOS style radio.
///
/// This property will only be used if [Radio.adaptive] shows the Cupertino
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please point to [CupertinoRadio.useCheckmarkStyle]

Comment on lines 440 to 445
/// Determines wether or not to use the checkbox style for the [CupertinoRadio]
/// control.
///
/// Only usable under the [RadioListTile.adaptive] constructor. If set to
/// true, on Apple platforms the radio button will appear as an iOS styled
/// checkmark.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please write near-identical documentation with radio.dart

@MitchellGoodwin MitchellGoodwin force-pushed the create-cupertino-radio branch from 1ac7557 to 6e2ba5e Compare May 15, 2023 17:29
Copy link
Member

@guidezpl guidezpl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  _    ___ _____ __  __ 
 | |  / __|_   _|  \/  |
 | |_| (_ | | | | |\/| |
 |____\___| |_| |_|  |_|
                        

@MitchellGoodwin MitchellGoodwin added the autosubmit Merge PR when tree becomes green via auto submit App label May 16, 2023
@auto-submit auto-submit bot merged commit 678f40c into flutter:master May 16, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 18, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 18, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 18, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 18, 2023
auto-submit bot pushed a commit to flutter/packages that referenced this pull request May 18, 2023
Roll Flutter from d0d1feb to 5ae6438 (42 revisions)

flutter/flutter@d0d1feb...5ae6438

2023-05-18 goderbauer@google.com Revert "Handle null return from WillPopCallback" (flutter/flutter#127112)
2023-05-18 engine-flutter-autoroll@skia.org Roll Flutter Engine from a22dd6438335 to 843ce0bba356 (6 revisions) (flutter/flutter#127116)
2023-05-18 christopherfujino@gmail.com mark windows build tests non-bringup (flutter/flutter#127059)
2023-05-18 engine-flutter-autoroll@skia.org Roll Flutter Engine from d97037077963 to a22dd6438335 (1 revision) (flutter/flutter#127071)
2023-05-18 engine-flutter-autoroll@skia.org Roll Packages from 5c69914 to b31a128 (9 revisions) (flutter/flutter#127109)
2023-05-18 jmccandless@google.com Revert "Remove obsolete drawShadow bounds workaround" (flutter/flutter#127110)
2023-05-18 36861262+QuncCccccc@users.noreply.github.com Clip search view content during animation (flutter/flutter#126975)
2023-05-18 flar@google.com Remove obsolete drawShadow bounds workaround (flutter/flutter#127052)
2023-05-17 737941+loic-sharma@users.noreply.github.com [Windows] Improve version migration message (flutter/flutter#127048)
2023-05-17 49699333+dependabot[bot]@users.noreply.github.com Bump actions/labeler from 9471598e3b7ff22b2fa181bd79addf94cb3e0847 to 6b107e7a7ee5e054e0bcce60de5181d21e2f00fb (flutter/flutter#127056)
2023-05-17 rmolivares@renzo-olivares.dev Remove deprecated fixTextFieldOutlineLabel (flutter/flutter#125893)
2023-05-17 engine-flutter-autoroll@skia.org Roll Flutter Engine from 331c5769e291 to d97037077963 (3 revisions) (flutter/flutter#127053)
2023-05-17 christopherfujino@gmail.com shard windows build tests 3 -> 4 (flutter/flutter#127057)
2023-05-17 engine-flutter-autoroll@skia.org Roll Flutter Engine from 0ae3719d7043 to 331c5769e291 (1 revision) (flutter/flutter#127049)
2023-05-17 srawlins@google.com Ignore unused_element_parameter (flutter/flutter#126926)
2023-05-17 engine-flutter-autoroll@skia.org Roll Flutter Engine from 47fd496c6f8d to 0ae3719d7043 (2 revisions) (flutter/flutter#127043)
2023-05-17 engine-flutter-autoroll@skia.org Roll Flutter Engine from 400a26ad8343 to 47fd496c6f8d (3 revisions) (flutter/flutter#127041)
2023-05-17 christopherfujino@gmail.com [flutter_tools] unpin and roll camera_android (flutter/flutter#126945)
2023-05-17 goderbauer@google.com Handle null return from WillPopCallback (flutter/flutter#127039)
2023-05-17 engine-flutter-autoroll@skia.org Roll Flutter Engine from 6048360c1837 to 400a26ad8343 (1 revision) (flutter/flutter#127036)
2023-05-17 goderbauer@google.com Remove unused (and untested) parameters from private _MasterDetailFlow (flutter/flutter#126935)
2023-05-17 jmccandless@google.com Autocomplete async examples (flutter/flutter#126283)
2023-05-17 danivangelis@hotmail.com Expose callback that allows focus traversal customization (flutter/flutter#120235)
2023-05-17 engine-flutter-autoroll@skia.org Roll Packages from b971830 to 5c69914 (5 revisions) (flutter/flutter#127034)
2023-05-17 engine-flutter-autoroll@skia.org Roll Flutter Engine from ea3f27383acc to 6048360c1837 (2 revisions) (flutter/flutter#127032)
2023-05-17 tessertaha@gmail.com Add missing `Switch.onFocusChange` test (flutter/flutter#126685)
2023-05-17 joshualitt@google.com Remove 'url_launcher' from pubspec.yaml. (flutter/flutter#126939)
2023-05-17 engine-flutter-autoroll@skia.org Roll Flutter Engine from 4b7c37532ea4 to ea3f27383acc (1 revision) (flutter/flutter#126994)
2023-05-17 engine-flutter-autoroll@skia.org Roll Flutter Engine from 170b45bae571 to 4b7c37532ea4 (1 revision) (flutter/flutter#126985)
2023-05-17 engine-flutter-autoroll@skia.org Roll Flutter Engine from 28b9dc993c30 to 170b45bae571 (1 revision) (flutter/flutter#126981)
2023-05-17 engine-flutter-autoroll@skia.org Roll Flutter Engine from 87a03e107df7 to 28b9dc993c30 (1 revision) (flutter/flutter#126974)
2023-05-17 engine-flutter-autoroll@skia.org Roll Flutter Engine from 1c775e34e2d5 to 87a03e107df7 (3 revisions) (flutter/flutter#126968)
2023-05-16 sigurdm@google.com Fix style issues (flutter/flutter#122586)
2023-05-16 engine-flutter-autoroll@skia.org Manual roll Flutter Engine from fe2476743b59 to 1c775e34e2d5 (10 revisions) (flutter/flutter#126961)
2023-05-16 ian@hixie.ch Make SlottedMultiChildRenderObjectWidgetMixin a concrete class (flutter/flutter#126108)
2023-05-16 ian@hixie.ch Add ScrollMetrics.extentTotal for completeness (flutter/flutter#126607)
2023-05-16 godofredoc@google.com Fix drone_dimensions. (flutter/flutter#126953)
2023-05-16 58190796+MitchellGoodwin@users.noreply.github.com Add checkmark style to CupertinoRadio (flutter/flutter#126480)
2023-05-16 54558023+keyonghan@users.noreply.github.com Move `Mac_build_test flutter_gallery__transition_perf_e2e_ios` to prod (flutter/flutter#126941)
2023-05-16 jason-simmons@users.noreply.github.com Fix DataTableThemeData.copyWith handling of dataRowHeight (flutter/flutter#126943)
2023-05-16 smushaheed@outlook.com Fix copyWith method of ActionIconThemeData (flutter/flutter#126763)
2023-05-16 zanderso@users.noreply.github.com Revert "Roll Flutter Engine from fe2476743b59 to 5cf141f7c03c (2 revisions)" (flutter/flutter#126954)

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
...
CaseyHillers pushed a commit to CaseyHillers/flutter that referenced this pull request May 24, 2023
Fixes: flutter#102813

Adds a checkmark style to the Cupertino Radio. Also allows the Radio.adaptive and RadioListTile.adaptive widgets to control whether they use the checkmark style for their Cupertino widgets or not.

This is how it looks in action:

https://github.com/flutter/flutter/assets/58190796/b409b270-42dd-404a-9350-d2c3e1d7fa4e
nploi pushed a commit to nploi/packages that referenced this pull request Jul 16, 2023
Roll Flutter from d0d1feb to 5ae6438 (42 revisions)

flutter/flutter@d0d1feb...5ae6438

2023-05-18 goderbauer@google.com Revert "Handle null return from WillPopCallback" (flutter/flutter#127112)
2023-05-18 engine-flutter-autoroll@skia.org Roll Flutter Engine from a22dd6438335 to 843ce0bba356 (6 revisions) (flutter/flutter#127116)
2023-05-18 christopherfujino@gmail.com mark windows build tests non-bringup (flutter/flutter#127059)
2023-05-18 engine-flutter-autoroll@skia.org Roll Flutter Engine from d97037077963 to a22dd6438335 (1 revision) (flutter/flutter#127071)
2023-05-18 engine-flutter-autoroll@skia.org Roll Packages from 5c69914 to b31a128 (9 revisions) (flutter/flutter#127109)
2023-05-18 jmccandless@google.com Revert "Remove obsolete drawShadow bounds workaround" (flutter/flutter#127110)
2023-05-18 36861262+QuncCccccc@users.noreply.github.com Clip search view content during animation (flutter/flutter#126975)
2023-05-18 flar@google.com Remove obsolete drawShadow bounds workaround (flutter/flutter#127052)
2023-05-17 737941+loic-sharma@users.noreply.github.com [Windows] Improve version migration message (flutter/flutter#127048)
2023-05-17 49699333+dependabot[bot]@users.noreply.github.com Bump actions/labeler from 9471598e3b7ff22b2fa181bd79addf94cb3e0847 to 6b107e7a7ee5e054e0bcce60de5181d21e2f00fb (flutter/flutter#127056)
2023-05-17 rmolivares@renzo-olivares.dev Remove deprecated fixTextFieldOutlineLabel (flutter/flutter#125893)
2023-05-17 engine-flutter-autoroll@skia.org Roll Flutter Engine from 331c5769e291 to d97037077963 (3 revisions) (flutter/flutter#127053)
2023-05-17 christopherfujino@gmail.com shard windows build tests 3 -> 4 (flutter/flutter#127057)
2023-05-17 engine-flutter-autoroll@skia.org Roll Flutter Engine from 0ae3719d7043 to 331c5769e291 (1 revision) (flutter/flutter#127049)
2023-05-17 srawlins@google.com Ignore unused_element_parameter (flutter/flutter#126926)
2023-05-17 engine-flutter-autoroll@skia.org Roll Flutter Engine from 47fd496c6f8d to 0ae3719d7043 (2 revisions) (flutter/flutter#127043)
2023-05-17 engine-flutter-autoroll@skia.org Roll Flutter Engine from 400a26ad8343 to 47fd496c6f8d (3 revisions) (flutter/flutter#127041)
2023-05-17 christopherfujino@gmail.com [flutter_tools] unpin and roll camera_android (flutter/flutter#126945)
2023-05-17 goderbauer@google.com Handle null return from WillPopCallback (flutter/flutter#127039)
2023-05-17 engine-flutter-autoroll@skia.org Roll Flutter Engine from 6048360c1837 to 400a26ad8343 (1 revision) (flutter/flutter#127036)
2023-05-17 goderbauer@google.com Remove unused (and untested) parameters from private _MasterDetailFlow (flutter/flutter#126935)
2023-05-17 jmccandless@google.com Autocomplete async examples (flutter/flutter#126283)
2023-05-17 danivangelis@hotmail.com Expose callback that allows focus traversal customization (flutter/flutter#120235)
2023-05-17 engine-flutter-autoroll@skia.org Roll Packages from b971830 to 5c69914 (5 revisions) (flutter/flutter#127034)
2023-05-17 engine-flutter-autoroll@skia.org Roll Flutter Engine from ea3f27383acc to 6048360c1837 (2 revisions) (flutter/flutter#127032)
2023-05-17 tessertaha@gmail.com Add missing `Switch.onFocusChange` test (flutter/flutter#126685)
2023-05-17 joshualitt@google.com Remove 'url_launcher' from pubspec.yaml. (flutter/flutter#126939)
2023-05-17 engine-flutter-autoroll@skia.org Roll Flutter Engine from 4b7c37532ea4 to ea3f27383acc (1 revision) (flutter/flutter#126994)
2023-05-17 engine-flutter-autoroll@skia.org Roll Flutter Engine from 170b45bae571 to 4b7c37532ea4 (1 revision) (flutter/flutter#126985)
2023-05-17 engine-flutter-autoroll@skia.org Roll Flutter Engine from 28b9dc993c30 to 170b45bae571 (1 revision) (flutter/flutter#126981)
2023-05-17 engine-flutter-autoroll@skia.org Roll Flutter Engine from 87a03e107df7 to 28b9dc993c30 (1 revision) (flutter/flutter#126974)
2023-05-17 engine-flutter-autoroll@skia.org Roll Flutter Engine from 1c775e34e2d5 to 87a03e107df7 (3 revisions) (flutter/flutter#126968)
2023-05-16 sigurdm@google.com Fix style issues (flutter/flutter#122586)
2023-05-16 engine-flutter-autoroll@skia.org Manual roll Flutter Engine from fe2476743b59 to 1c775e34e2d5 (10 revisions) (flutter/flutter#126961)
2023-05-16 ian@hixie.ch Make SlottedMultiChildRenderObjectWidgetMixin a concrete class (flutter/flutter#126108)
2023-05-16 ian@hixie.ch Add ScrollMetrics.extentTotal for completeness (flutter/flutter#126607)
2023-05-16 godofredoc@google.com Fix drone_dimensions. (flutter/flutter#126953)
2023-05-16 58190796+MitchellGoodwin@users.noreply.github.com Add checkmark style to CupertinoRadio (flutter/flutter#126480)
2023-05-16 54558023+keyonghan@users.noreply.github.com Move `Mac_build_test flutter_gallery__transition_perf_e2e_ios` to prod (flutter/flutter#126941)
2023-05-16 jason-simmons@users.noreply.github.com Fix DataTableThemeData.copyWith handling of dataRowHeight (flutter/flutter#126943)
2023-05-16 smushaheed@outlook.com Fix copyWith method of ActionIconThemeData (flutter/flutter#126763)
2023-05-16 zanderso@users.noreply.github.com Revert "Roll Flutter Engine from fe2476743b59 to 5cf141f7c03c (2 revisions)" (flutter/flutter#126954)

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
...
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 16, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 17, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 17, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosubmit Merge PR when tree becomes green via auto submit App f: cupertino flutter/packages/flutter/cupertino repository f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cupertino style radio button (single-selection)
3 participants