forked from eatvio/eatvio_app
feat: Implement auto-scrolling to the first validation error in the create diet form and refine image validation logic.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user