I have this Firebase Document that I want to convert to a JSON and add Id to it when using it within the app.
factory Recipe.fromDocument(DocumentSnapshot doc) {
final data = doc.data()!;
return Recipe.fromJson(data).copyWith(id: doc.id);
}