feat(my_diets): fixed draft, active and personal diets creation, updating

This commit is contained in:
misha
2026-02-09 10:39:51 +03:00
parent 400cc004ef
commit c91e83adaf
12 changed files with 221 additions and 110 deletions

View File

@@ -251,7 +251,7 @@ class _MyDietWidgetState extends State<MyDietWidget> {
Expanded(
child: CustomOutlinedButton(
onPressed: () async {
GoRouter.of(context).pushNamed(DietPreviewScreen.name, extra: widget.diet);
GoRouter.of(context).pushNamed(DietPreviewScreen.name, extra: {'diet': widget.diet, 'isImageInBase64': false});
},
text: 'Превью',
height: 52,
@@ -263,6 +263,22 @@ class _MyDietWidgetState extends State<MyDietWidget> {
),
),
),
const SizedBox(width: 6),
CustomOutlinedButton(
onPressed: () async {
_deleteDiet(widget.diet, context);
},
height: 52,
width: 52,
leftIcon: SvgPicture.asset('assets/icons/trash_can.svg', width: 20, height: 20),
buttonTextStyle: TextStyles.textMSemibold.copyWith(color: appTheme.red),
buttonStyle: ButtonStyle(
shape: WidgetStatePropertyAll(RoundedRectangleBorder(borderRadius: BorderRadius.circular(20))),
backgroundColor: WidgetStatePropertyAll(appTheme.lightGray0),
side: const WidgetStatePropertyAll(BorderSide.none),
),
text: '',
),
],
),
],