feat:更新编辑菜谱功能
This commit is contained in:
@@ -131,11 +131,8 @@ class Recipe {
|
||||
List<RecipeStep> stepList;
|
||||
List<FoodRecord> recordList;
|
||||
List<int> likeList;
|
||||
int likeCount;
|
||||
List<int> favouriteList;
|
||||
int favouriteCount;
|
||||
List<RecipeComment> commentList;
|
||||
int commentCount;
|
||||
|
||||
Recipe({
|
||||
required this.id,
|
||||
@@ -151,11 +148,8 @@ class Recipe {
|
||||
required this.stepList,
|
||||
required this.recordList,
|
||||
required this.likeList,
|
||||
required this.likeCount,
|
||||
required this.favouriteList,
|
||||
required this.favouriteCount,
|
||||
required this.commentList,
|
||||
required this.commentCount,
|
||||
});
|
||||
|
||||
factory Recipe.fromJson(Map<String, dynamic> json) => _$RecipeFromJson(json);
|
||||
@@ -177,11 +171,8 @@ class Recipe {
|
||||
stepList: [],
|
||||
recordList: [],
|
||||
likeList: [],
|
||||
likeCount: 0,
|
||||
favouriteList: [],
|
||||
favouriteCount: 0,
|
||||
commentList: [],
|
||||
commentCount: 0,
|
||||
commentList: []
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,17 +106,14 @@ Recipe _$RecipeFromJson(Map<String, dynamic> json) => Recipe(
|
||||
(json['likeList'] as List<dynamic>)
|
||||
.map((e) => (e as num).toInt())
|
||||
.toList(),
|
||||
likeCount: (json['likeCount'] as num).toInt(),
|
||||
favouriteList:
|
||||
(json['favouriteList'] as List<dynamic>)
|
||||
.map((e) => (e as num).toInt())
|
||||
.toList(),
|
||||
favouriteCount: (json['favouriteCount'] as num).toInt(),
|
||||
commentList:
|
||||
(json['commentList'] as List<dynamic>)
|
||||
.map((e) => RecipeComment.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
commentCount: (json['commentCount'] as num).toInt(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$RecipeToJson(Recipe instance) => <String, dynamic>{
|
||||
@@ -133,11 +130,8 @@ Map<String, dynamic> _$RecipeToJson(Recipe instance) => <String, dynamic>{
|
||||
'stepList': instance.stepList,
|
||||
'recordList': instance.recordList,
|
||||
'likeList': instance.likeList,
|
||||
'likeCount': instance.likeCount,
|
||||
'favouriteList': instance.favouriteList,
|
||||
'favouriteCount': instance.favouriteCount,
|
||||
'commentList': instance.commentList,
|
||||
'commentCount': instance.commentCount,
|
||||
};
|
||||
|
||||
RecipeSummary _$RecipeSummaryFromJson(Map<String, dynamic> json) =>
|
||||
|
||||
Reference in New Issue
Block a user