glossary for diet creation fixed

This commit is contained in:
Username1548
2024-12-11 19:51:40 +07:00
parent 746e16f94e
commit e9a4c518be
5 changed files with 19 additions and 11 deletions

View File

@@ -1,6 +1,7 @@
import 'package:eatvio_app/features/diary/presentation/bloc/diary_cubit.dart';
import 'package:eatvio_app/core/theme/theme_helper.dart';
import 'package:eatvio_app/core/widgets/custom_text_form_field.dart';
import 'package:eatvio_app/features/glossary/models/glossary_model.dart';
import 'package:flutter/material.dart';
import 'package:lottie/lottie.dart';
@@ -27,7 +28,7 @@ class _GlossaryModerationRequestModalWidgetState extends State<GlossaryModeratio
final proteinsController = TextEditingController();
final fatsController = TextEditingController();
final carbohydratesController = TextEditingController();
GlossaryModel? glossary;
@override
Widget build(BuildContext context) {
if (glossaryState == GlossaryState.alert) {
@@ -160,7 +161,7 @@ class _GlossaryModerationRequestModalWidgetState extends State<GlossaryModeratio
const SizedBox(height: 16),
InkWell(
onTap: () {
Navigator.of(context).pop();
Navigator.of(context).pop(glossary);
},
borderRadius: BorderRadius.circular(20),
child: Ink(
@@ -263,7 +264,7 @@ class _GlossaryModerationRequestModalWidgetState extends State<GlossaryModeratio
const SizedBox(height: 12),
InkWell(
onTap: () async {
await widget.diaryCubit.sendProductToModeration(
glossary = (await widget.diaryCubit.sendProductToModeration(
name: productNameController.text,
energy: double.parse(energyController.text),
proteins: double.parse(proteinsController.text),