Add enabled property to CheckboxlistTile #102314
Add enabled property to CheckboxlistTile #102314fluttergithubbot merged 8 commits intoflutter:masterfrom maheshj01:checkboxlisttile-feat
Conversation
There was a problem hiding this comment.
nit: I think maybe double slash // here would be better? Got some hints from Style Guide for Flutter:)
There was a problem hiding this comment.
This doesn't really match the standard format for Flutter class comments. See https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#dartdoc-specific-requirements
This feature is supposed to work like the ListTile version, so you could use that as a model: https://api.flutter.dev/flutter/material/ListTile/enabled.html
There was a problem hiding this comment.
I suppose this could be: enabled ?? false : null : onChanged
There was a problem hiding this comment.
Thanks for the review, Probably you meant
enabled ?? false ? null : onChangedBut, this wouldn't work for a case when enabled is true.
When enabled is true onChanged would be null. For this API I think onChanged should be enabled (non null) only when enabled is true.
There was a problem hiding this comment.
We probably want to pass null when enabled is false. In this case, this might work:
(enabled ?? true) ? onChanged :null
|
This pull request executed golden file tests, but it has not been updated in a while (20+ days). Test results from Gold expire after as many days, so this pull request will need to be updated with a fresh commit in order to get results from Gold. 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. |
|
Can someone please check why the docs-linux test is failing ?
|
Co-authored-by: Aman Verma <[email protected]>
| final Widget control = Checkbox( | ||
| value: value, | ||
| onChanged: onChanged, | ||
| onChanged: enabled ?? true ? onChanged : null , |
Adds enabled property to CheckboxListTile.
Fixes: #102219
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.