-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Create CupertinoRadio Widget #123296
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
Create CupertinoRadio Widget #123296
Conversation
gspencergoog
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.
Both of the examples will need tests. See some of the other tests under examples/api/test to see how they're written. They're pretty simple tests just to make sure that the example displays the expected components of the example.
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.
You should give this a more specific name: (e.g. 'CuptertinoRadio Example').
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.
Try naming the app something like "CupertinoRadioApp" or something to make it match the example.
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.
| // Flutter code sample for [CupertinoRadio]. | |
| /// Flutter code sample for [CupertinoRadio]. |
This should be a doc comment so that IDE users can click on the link to get back to the class the example is attached to.
You might need to move this below the import if the analyzer complains.
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.
You can probably get rid of this. The title is not really used on iOS, I don't think. On Android it's used when you pull down the window shade, but that's all.
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.
Name this something specific to this example: CupertinoRadioExample or something.
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.
| /// radio button with the new [groupValue]. | |
| /// radio button with a new [groupValue]. |
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.
| /// ** See code in examples/api/lib/cupertino/radio/radio.toggleable.0.dart ** | |
| /// ** See code in examples/api/lib/cupertino/radio/cupertino_radio.toggleable.0.dart ** |
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 it really a "shadow"? I think I'd call it just a 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.
You might move this to a named constant at the top of the file.
29f8af3 to
783cf86
Compare
783cf86 to
815fbe3
Compare
gspencergoog
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.
Create CupertinoRadio Widget

Addresses #102813. Adds a radio widget to Cupertino. Like the checkbox, this will be made adaptable with the Material radio widget.
Here's the radio buttons in the macOS settings:

And here's the Cupertino version in action, including keyboard focus/ interaction:
Screen.Recording.2023-03-22.at.3.49.57.PM.mov
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.