You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a class that has a double property, it deserializes just fine with "proper" json ... ie ("fontsize": 24 }
I would ALSO like to be able to deserialize with with "stringy" json (ie ie ("fontsize": "24" }
@freezed
abstract class WhackTextStyle with _$WhackTextStyle {
const factory SWhackTextStyle({
String? color,
double? fontSize,
}) = _WhackTextStyle;
This is the generated code for handling this double property ... are there any config or clever ways to have this also parse the string value to double ?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I have a class that has a
doubleproperty, it deserializes just fine with "proper" json ... ie ("fontsize": 24 }I would ALSO like to be able to deserialize with with "stringy" json (ie ie ("fontsize": "24" }
This is the generated code for handling this double property ... are there any config or clever ways to have this also parse the string value to double ?
Beta Was this translation helpful? Give feedback.
All reactions