fixed profile, recipeis and diets

This commit is contained in:
Username1548
2025-02-10 21:50:13 +07:00
parent 5ea3264474
commit 070d7e1047
51 changed files with 1382 additions and 1360 deletions

View File

@@ -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 {