Replies: 1 comment
-
I found this UserDocumentReference docRefFromJson(String id) => usersRef.doc(id);
String docRefToJson(UserDocumentReference ref) => ref.id;
@freezed
class Tweet with _$Tweet {
const factory Tweet(
@Id() required String id,
required String tweet,
@JsonKey(fromJson: docRefFromJson, toJson: docRefToJson)
required UserDocumentReference author,
) = _Tweet;
} but got error
// ...
_$_Task _$$_TaskFromJson(Map<String, dynamic> json) => _$_Task(
id: json['id'] as String,
tweet: json['tweet'] as String,
author: docRefFromJson(json['from'] as String), // <-Error occurred here
// ... |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I want to make a model like this.
Beta Was this translation helpful? Give feedback.
All reactions