feat(diary): Image layout fixed by figma design

This commit is contained in:
2024-03-29 16:40:46 +03:00
parent 0dbf487108
commit aa9ccd26e7
2 changed files with 5 additions and 4 deletions

View File

@@ -436,7 +436,8 @@ class DiaryEditBloc extends Bloc<DiaryEditEvent, DiaryEditState> {
return response;
}
FutureOr<void> _changeMeal(ChangeMeal event, Emitter<DiaryEditState> emit) {
FutureOr<void> _changeMeal(
ChangeMeal event, Emitter<DiaryEditState> emit) async {
if (state is DiaryEditLoadedState) {
var currentState = state as DiaryEditLoadedState;
final meal = currentState.meals?.firstWhere(
@@ -444,7 +445,6 @@ class DiaryEditBloc extends Bloc<DiaryEditEvent, DiaryEditState> {
orElse: () => null);
int? id = event.value.id;
DiaryEditLoadedState updatedState = currentState.copyWith(
currentMeal: event.value,
portions: meal['portions'],
@@ -660,6 +660,7 @@ class DiaryEditBloc extends Bloc<DiaryEditEvent, DiaryEditState> {
await uploadImageToServer(event.image.path, currentState.diaryId,
currentState.currentMeal!.id!, currentState.token);
await reloadScreen(event, emit);
}
}

View File

@@ -393,13 +393,13 @@ class DiaryEditScreen extends StatelessWidget {
.map((portion) => _buildProduct(context, portion))
.toList(),
SizedBox(height: 30.v),
_buildAddPhoto(context),
SizedBox(height: 30.v),
...state.photos != null
? state.photos!
.map((photo) => _buildPhoto(context, photo))
.toList()
: [],
SizedBox(height: 20.v),
_buildAddPhoto(context),
SizedBox(height: 30.v),
Text(
"Ваша сытость после приёма пищи",