title: Freezed and json_serializable: How to use a custom converter
body: <p>I want to add a custom converter to a freezed class like in <a href="https://stackoverflow.com/questions/60793441/how-do-i-resolve-type-timestamp-is-not-a-subtype-of-type-string-in-type-cast">this answer</a>.</p>
  <p>I tried it with this code:</p>
  <pre><code>@freezed
  class NewsPost with _$NewsPost {
    factory NewsPost({
      @JsonKey(name: &quot;date&quot;) @TimestampConverter() DateTime? date,
    }) = _NewsPost;
  
    factory NewsPost.fromJson(Map&lt;String, dynamic&gt; json) =&gt;
        _$NewsPostFromJson(json);
  }
  </code></pre>
  <p>But it did not work. Any ideas are more than welcome!</p>
  <p>For your interest, this is my Converter:</p>
  <pre><code>class TimestampConverter implements JsonConverter&lt;DateTime, Timestamp&gt; {
    const TimestampConverter();
  
    @override
    DateTime fromJson(Timestamp timestamp) {
      return timestamp.toDate();
    }
  
    @override
    Timestamp toJson(DateTime date) =&gt; Timestamp.fromDate(date);
  }
  </code></pre>
  <p>Thank you :-)</p>