forked from eatvio/eatvio_app
fixed profile, recipeis and diets
This commit is contained in:
@@ -101,12 +101,20 @@ class CreateRecipeCubit extends Cubit<CreateRecipeState> {
|
||||
emit(state.copyWith.entity(energyInOnePortion: energy));
|
||||
}
|
||||
|
||||
replaceTotalTime(String time) {
|
||||
emit(state.copyWith.entity(totalCookTime: time));
|
||||
setTotalCookingMinutes(int minutes) {
|
||||
emit(state.copyWith.entity(totalCookMinutes: minutes));
|
||||
}
|
||||
|
||||
replaceActiveTime(String time) {
|
||||
emit(state.copyWith.entity(activeCookTime: time));
|
||||
setTotalCookingHours(int hours) {
|
||||
emit(state.copyWith.entity(totalCookHours: hours));
|
||||
}
|
||||
|
||||
setActiveCookingMinutes(int minutes) {
|
||||
emit(state.copyWith.entity(activeCookMinutes: minutes));
|
||||
}
|
||||
|
||||
setActiveCookingHours(int hours) {
|
||||
emit(state.copyWith.entity(activeCookHours: hours));
|
||||
}
|
||||
|
||||
replaceVideoUrl(String videoUrl) {
|
||||
@@ -190,7 +198,7 @@ class CreateRecipeCubit extends Cubit<CreateRecipeState> {
|
||||
}
|
||||
|
||||
bool validateActiveCookTime() {
|
||||
if (state.entity.activeCookTime == null || state.entity.activeCookTime == '00:00') {
|
||||
if (state.entity.activeCookHours == null && state.entity.activeCookMinutes == null) {
|
||||
emit(state.copyWith(activeTimeValidationError: 'Поле не заполнено'));
|
||||
return false;
|
||||
} else {
|
||||
@@ -200,7 +208,7 @@ class CreateRecipeCubit extends Cubit<CreateRecipeState> {
|
||||
}
|
||||
|
||||
bool validateTotalCookTime() {
|
||||
if (state.entity.totalCookTime == null || state.entity.totalCookTime == '00:00') {
|
||||
if (state.entity.totalCookHours == null || state.entity.totalCookMinutes == null) {
|
||||
emit(state.copyWith(cookingTimeValidationError: 'Поле не заполнено'));
|
||||
return false;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user