Category "json-serializable"

Freezed class with enum property throws error upon trying to serialize

I have a freezed class that takes an enum in its constructor, but when trying to perform the jsonEncode method on this class, it fails with the following error:

Freezed and json_serializable: How to use a custom converter

I want to add a custom converter to a freezed class like in this answer. I tried it with this code: @freezed class NewsPost with _$NewsPost { factory NewsPost

Flutter: json_serializable ignore nullable fields instead of throwing an error

Suppose there are two models User and City @JsonSerializable() class User { int id; String name; City? city; List<Map<String, City>>