Closed jsarafajr closed 9 months ago
Thank you for bringing this side effect of the API change to my attention.
It was definitely not my intention to change the ResponsiveVisibility API in this way. This new usage is much more awkward and bad.
Conditions now require a value to support nullability inheritance. Without requiring the value, the library cannot infer the nullability.
I wonder what can be done here? 🥶
The issue was a Dart language limitation that did not support generic type nullability. With the latest Flutter v3.19, nullable generic types now flow through correctly and the awkwardness can be removed.
We're back to the original API where a constant condition can be passed without forcibly attaching a value!
Since value property is now required on breakpoint condition it forces you to pass it in the ResponsiveVisibility conditions even though it's not used:
while probably the expected usage would be to not pass it in this case:
Right now you get
The named parameter 'value' is required, but there's no corresponding argument.
when trying to do so.