fix(diary) Fixed an issue

This commit is contained in:
2024-03-26 17:03:24 +03:00
parent 825c2ddc2d
commit 9923d06e82
2 changed files with 52 additions and 5 deletions

View File

@@ -687,7 +687,7 @@ class DiaryEditBloc extends Bloc<DiaryEditEvent, DiaryEditState> {
SendModeration event, Emitter<DiaryEditState> emit) async {
if (state is DiaryEditLoadedState) {
var currentState = state as DiaryEditLoadedState;
print("sad");
final response = await _sendModerationData(
event.name,
event.energyOn100gr,
@@ -730,7 +730,7 @@ class DiaryEditBloc extends Bloc<DiaryEditEvent, DiaryEditState> {
return response;
} else {
throw Exception(
'Failed to upload image. Status code: ${response.statusCode}');
'Failed to send a product for moderation ${response.statusCode}');
}
}

View File

@@ -517,11 +517,11 @@ class DiaryEditScreen extends StatelessWidget {
),
actions: <Widget>[
TextButton(
onPressed: () => popDialog,
onPressed: popDialog(context),
child: Text('Отмена'),
),
TextButton(
onPressed: () => triggerModeration(
onPressed: triggerModeration(
context,
name,
energyOn100gr,
@@ -537,7 +537,7 @@ class DiaryEditScreen extends StatelessWidget {
);
}
Function triggerModeration(
triggerModeration(
BuildContext context,
String name,
String energyOn100gr,
@@ -789,6 +789,53 @@ class DiaryEditScreen extends StatelessWidget {
),
),
SizedBox(height: 2.v),
Padding(
padding: EdgeInsets.only(
left: 10.h,
right: 2.h,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Калорий",
style: theme.textTheme.bodySmall,
),
Padding(
padding: EdgeInsets.only(
left: 25.h,
bottom: 11.v,
),
child: Text(
"Белков",
style: theme.textTheme.bodySmall,
),
),
Padding(
padding: EdgeInsets.only(
left: 19.h,
bottom: 11.v,
),
child: Text(
"Жиров",
style: theme.textTheme.bodySmall,
),
),
Padding(
padding: EdgeInsets.only(
left: 14.h,
bottom: 11.v,
),
child: Text(
"Углеводов",
style: theme.textTheme.bodySmall,
),
),
],
),
),
SizedBox(height: 2.v),
Padding(
padding: EdgeInsets.only(
left: 10.h,