Closed BWhiteApps closed 3 months ago
Some languages will output json for doubles in a format that will break the current way genq is handling doubles and ints.
Ex:
{ "someDoubleValue": 30.4, "anotherDoubleValue": 30, "someIntValue": 30, }
This will break the deserialization when trying to use a double with "anotherDoubleValue".
Instead of generating the following bodyFontSize: json['anotherDoubleValue'] == null ? null : json['anotherDoubleValue'] as double?
bodyFontSize: json['anotherDoubleValue'] == null ? null : json['anotherDoubleValue'] as double?
Follow JsonSerializableGenerator's lead on this and do (json['anotherDoubleValue'] as num?)?.toDouble()
(json['anotherDoubleValue'] as num?)?.toDouble()
Fixed in 0.5.0
brew upgrade jankuss/genq/genq
Some languages will output json for doubles in a format that will break the current way genq is handling doubles and ints.
Ex:
This will break the deserialization when trying to use a double with "anotherDoubleValue".
Instead of generating the following
bodyFontSize: json['anotherDoubleValue'] == null ? null : json['anotherDoubleValue'] as double?
Follow JsonSerializableGenerator's lead on this and do
(json['anotherDoubleValue'] as num?)?.toDouble()