forked from eatvio/eatvio_app
feat(recipe): Recipe create layouts
This commit is contained in:
@@ -35,12 +35,18 @@ class RecipeCreateBloc extends Bloc<RecipeCreateEvent, RecipeCreateState> {
|
||||
recipeModelObj: currentState.recipeModelObj,
|
||||
title: currentState.title,
|
||||
description: currentState.description,
|
||||
video_url: currentState.video_url));
|
||||
video_url: currentState.video_url,
|
||||
steps: currentState.steps));
|
||||
} else {
|
||||
final Map<String, dynamic> step = {
|
||||
'description': '',
|
||||
'image': '',
|
||||
};
|
||||
emit(RecipeCreateLoadedState(
|
||||
title: TextEditingController(),
|
||||
description: TextEditingController(),
|
||||
video_url: TextEditingController()));
|
||||
video_url: TextEditingController(),
|
||||
steps: [step]));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,25 +23,33 @@ class RecipeCreateState extends Equatable {
|
||||
|
||||
class RecipeCreateLoadedState extends RecipeCreateState {
|
||||
RecipeCreateLoadedState(
|
||||
{this.recipeModelObj, this.title, this.description, this.video_url});
|
||||
{this.recipeModelObj,
|
||||
this.title,
|
||||
this.description,
|
||||
this.video_url,
|
||||
this.steps});
|
||||
|
||||
RecipeCreateModel? recipeModelObj;
|
||||
TextEditingController? title;
|
||||
TextEditingController? description;
|
||||
TextEditingController? video_url;
|
||||
List<dynamic>? steps;
|
||||
@override
|
||||
List<Object?> get props => [recipeModelObj, title, description, video_url];
|
||||
List<Object?> get props =>
|
||||
[recipeModelObj, title, description, video_url, steps];
|
||||
RecipeCreateLoadedState copyWith({
|
||||
RecipeCreateModel? recipeModelObj,
|
||||
TextEditingController? title,
|
||||
TextEditingController? description,
|
||||
TextEditingController? video_url,
|
||||
List<dynamic>? steps,
|
||||
}) {
|
||||
return RecipeCreateLoadedState(
|
||||
recipeModelObj: recipeModelObj ?? this.recipeModelObj,
|
||||
title: title ?? this.title,
|
||||
description: description ?? this.description,
|
||||
video_url: video_url ?? this.video_url,
|
||||
steps: steps ?? this.steps,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user