I'm trying to save a DocumentReference in models using JSON serializable with a custom JsonConverter but not doing it correct
here is my model
@DocumentSerializer()
DocumentReference? recentTrainingRef;
My DocumentSerializer Class
class DocumentSerializer
implements JsonConverter<DocumentReference, DocumentReference> {
const DocumentSerializer();
@override
DocumentReference fromJson(DocumentReference docRef) => docRef;
@override
DocumentReference toJson(DocumentReference docRef) => docRef;
}
I'm getting the following error Could not generate fromJson code for recentTrainingRef.