forked from eatvio/eatvio_app
feat(diary): Image layout fixed by figma design
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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(
|
||||
"Ваша сытость после приёма пищи",
|
||||
|
||||
Reference in New Issue
Block a user