fix: glossary modeartion

This commit is contained in:
Alex
2024-12-09 11:16:20 +03:00
parent 178060e85e
commit afdcea1e1f
6 changed files with 20 additions and 26 deletions

View File

@@ -1,7 +1,6 @@
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';
@@ -28,7 +27,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) {
@@ -161,7 +160,7 @@ class _GlossaryModerationRequestModalWidgetState extends State<GlossaryModeratio
const SizedBox(height: 16),
InkWell(
onTap: () {
Navigator.of(context).pop(glossary);
Navigator.of(context).pop();
},
borderRadius: BorderRadius.circular(20),
child: Ink(
@@ -264,14 +263,13 @@ class _GlossaryModerationRequestModalWidgetState extends State<GlossaryModeratio
const SizedBox(height: 12),
InkWell(
onTap: () async {
glossary = (await widget.diaryCubit.sendProductToModeration(
await widget.diaryCubit.sendProductToModeration(
name: productNameController.text,
energy: double.parse(energyController.text),
proteins: double.parse(proteinsController.text),
fats: double.parse(fatsController.text),
carbohydrates: double.parse(carbohydratesController.text),
))
.glossary;
);
setState(() {
glossaryState = GlossaryState.success;
});