my diets have been update

This commit is contained in:
Username1548
2025-02-17 14:40:31 +07:00
parent 070d7e1047
commit 291947bd32
98 changed files with 4969 additions and 2670 deletions

View File

@@ -233,7 +233,13 @@ class _CreateDietScreenContentState extends State<CreateDietScreenContent> {
else
CustomOutlinedButton(
onPressed: () {
context.read<CreateDietCubit>().publishDiet();
if (widget.diet != null) {
context.read<CreateDietCubit>().updateDiet(
widget.diet!.id,
);
} else {
context.read<CreateDietCubit>().createDiet();
}
},
text: widget.diet != null ? s.save : s.publish,
height: 52,