Migrate android_semantics_testing to null safety#111420
Migrate android_semantics_testing to null safety#111420auto-submit[bot] merged 2 commits intoflutter:masterfrom
Conversation
| } | ||
|
|
||
| void _updateRadio(int newValue) { | ||
| void _updateRadio(int? newValue) { |
There was a problem hiding this comment.
It seems like this should not be nullable, since is always asserted to be non-null. Either that, or below it shouldn't assert, but rather set to zero or something if the value is null.
There was a problem hiding this comment.
The function signature is ValueChange(T?), It can be null if the radioButton is toggle-able. Since the radiobutton is built without toggle-able. I can be sure it won't be null.
There was a problem hiding this comment.
No, I don't mean add an assert (I was calling the ! an assertion that it is non-null, which it is, but it's not an "assert", sorry for being confusing).
I'm just saying that if the argument is nullable, and you always force the value to be non-null, then perhaps either the argument should be also non-nullable (which I understand is different than the signature for Radio.onChanged), or the value shouldn't be always forced to non-nullable, and be something like _radio = newValue ?? 0 instead of _radio = newValue!.
There was a problem hiding this comment.
It can be nullable for the different use cases of RadioButton, but It can't be null in the RadioButton use case in this file.
If it is null here, that means something is wrong in the code in this file. I think a force cast would be more preferable in this case?
There was a problem hiding this comment.
Yeah,OK, I guess since it's a test it's probably fine.
)" This reverts commit e993419.

fixes #90633
4th attempt after a year. Let us pray
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.