feat: Implement auto-scrolling to the first validation error in the create diet form and refine image validation logic.

This commit is contained in:
mso7nueh
2026-02-09 23:15:12 +03:00
parent 531f732b1a
commit d70aaf955f
2 changed files with 50 additions and 8 deletions

View File

@@ -394,11 +394,11 @@ class CreateDietCubit extends Cubit<CreateDietState> {
result = false;
emit(state.copyWith(dietStateError: 'Статус диеты не выбран'));
}
if (state.dietData.image == null) {
if (state.dietData.image == null && state.dietData.imageUrl == null) {
result = false;
emit(state.copyWith(dietImageError: 'Не добавлена обложка'));
}
result = _isDailyScheduleValid();
result = _isDailyScheduleValid() && result;
return result;
}