forked from eatvio/eatvio_app
feat(recipe): API for recipe create and edit
This commit is contained in:
@@ -6,16 +6,9 @@ part of 'recipe_model.dart';
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$RecipeModelImpl _$$RecipeModelImplFromJson(Map<String, dynamic> json) =>
|
||||
_$RecipeModelImpl(
|
||||
ingredients: (json['ingredients'] as List<dynamic>?)
|
||||
?.map((e) =>
|
||||
e == null ? null : Ingredient.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
steps: (json['steps'] as List<dynamic>?)
|
||||
?.map((e) =>
|
||||
e == null ? null : Step.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
_$RecipeModelImpl _$$RecipeModelImplFromJson(Map<String, dynamic> json) => _$RecipeModelImpl(
|
||||
ingredients: (json['ingredients'] as List<dynamic>?)?.map((e) => e == null ? null : Ingredient.fromJson(e as Map<String, dynamic>)).toList(),
|
||||
steps: (json['steps'] as List<dynamic>?)?.map((e) => e == null ? null : Step.fromJson(e as Map<String, dynamic>)).toList(),
|
||||
type: json['type'] as String?,
|
||||
state: json['state'] as String?,
|
||||
title: json['title'] as String?,
|
||||
@@ -25,8 +18,7 @@ _$RecipeModelImpl _$$RecipeModelImplFromJson(Map<String, dynamic> json) =>
|
||||
cooking_time: (json['cooking_time'] as num?)?.toInt(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$RecipeModelImplToJson(_$RecipeModelImpl instance) =>
|
||||
<String, dynamic>{
|
||||
Map<String, dynamic> _$$RecipeModelImplToJson(_$RecipeModelImpl instance) => <String, dynamic>{
|
||||
'ingredients': instance.ingredients,
|
||||
'steps': instance.steps,
|
||||
'type': instance.type,
|
||||
|
||||
@@ -472,6 +472,8 @@ class RecipeCreateScreen extends StatelessWidget {
|
||||
image: state.recipeImage?.path,
|
||||
video_url: state.youtubeLinkController.text.isNotEmpty ? state.youtubeLinkController.text : null,
|
||||
);
|
||||
print(recipe.toJson());
|
||||
print(recipe.toString());
|
||||
print(recipe);
|
||||
return recipe;
|
||||
}
|
||||
|
||||
@@ -487,7 +487,6 @@ class RecipeEditScreen extends StatelessWidget {
|
||||
image: state.recipeImage?.path,
|
||||
video_url: state.youtubeLinkController.text.isNotEmpty ? state.youtubeLinkController.text : null,
|
||||
);
|
||||
print(recipe.toJson());
|
||||
return recipe;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user