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

@@ -8,32 +8,33 @@ import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
class SuccessPublishedDietOrPlanBottomSheet extends StatelessWidget {
const SuccessPublishedDietOrPlanBottomSheet({super.key, required this.title, this.isPlan = false});
const SuccessPublishedDietOrPlanBottomSheet({super.key, required this.title, this.isPlan = false, this.isDrafted, this.isUpdated});
final String title;
final bool isPlan;
final bool? isDrafted;
final bool? isUpdated;
@override
Widget build(BuildContext context) {
final s = S.of(context);
final String text;
if (isDrafted == true) {
text = 'cохранена в черновиках';
} else if (isUpdated == true) {
text = 'успешно обновлена';
} else if (isPlan == true) {
text = 'опубликован';
} else {
text = 'опубликованна';
}
return Column(
children: [
const SizedBox(
height: 20,
),
const SizedBox(height: 20),
const BottomSheetHandlerBar(),
const SizedBox(
height: 20,
),
Text(
title,
style: TextStyles.headingXLSemibold.copyWith(color: appTheme.black),
),
Text(
isPlan ? 'опубликован' : 'опубликованна',
style: TextStyles.headingXLSemibold.copyWith(color: appTheme.black),
),
const SizedBox(
height: 20,
),
const SizedBox(height: 20),
Text(title, style: TextStyles.headingXLSemibold.copyWith(color: appTheme.black)),
Text(text, style: TextStyles.headingXLSemibold.copyWith(color: appTheme.black)),
const SizedBox(height: 20),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 20),
child: CustomOutlinedButton(
@@ -43,15 +44,10 @@ class SuccessPublishedDietOrPlanBottomSheet extends StatelessWidget {
text: s.ok,
height: 52,
buttonTextStyle: TextStyles.textSSemibold.copyWith(color: appTheme.whiteA700),
buttonStyle: ButtonStyle(
side: const WidgetStatePropertyAll(BorderSide.none),
backgroundColor: WidgetStatePropertyAll(appTheme.blueA400),
),
buttonStyle: ButtonStyle(side: const WidgetStatePropertyAll(BorderSide.none), backgroundColor: WidgetStatePropertyAll(appTheme.blueA400)),
),
),
const SizedBox(
height: 20,
),
const SizedBox(height: 20),
],
);
}