fix(diary): added proccesing of future dates and fixed deleted portions

This commit is contained in:
Username1548
2025-04-08 21:28:40 +07:00
parent 245c854754
commit 823dc78490
25 changed files with 1038 additions and 371 deletions

View File

@@ -33,7 +33,7 @@ class _DiaryScreenState extends State<DiaryScreen> {
}
if (state is DiaryStateError) {
return Scaffold(
body: DataErrorWidget(onReload: context.read<DiaryCubit>().fetchDiary()),
body: DataErrorWidget(onReload: () => context.read<DiaryCubit>().fetchDiary()),
);
}
return Scaffold(
@@ -48,12 +48,15 @@ class _DiaryScreenState extends State<DiaryScreen> {
children: [
const CalendarWidget(),
if (state is DiaryStateLoading) const Loader(),
if (state is DiaryStateLoaded) const WakeupAndRetireWidget(),
if (state is DiaryStateLoaded) WakeupAndRetireWidget(showRetire: state.diary.typeOfDiary.hasChosenPlan),
const SizedBox(height: 12),
if (state is DiaryStateLoaded) const MealWidget(),
if (state is DiaryStateLoaded)
MealWidget(
showMood: state.diary.typeOfDiary.hasChosenPlan,
),
if (state is DiaryStateLoaded) const CaloriesChartWidget(),
const SizedBox(height: 12),
if (state is DiaryStateLoaded) const CommentForConsultantWidget(),
if (state is DiaryStateLoaded && state.diary.typeOfDiary.hasChosenPlan) const CommentForConsultantWidget(),
if (state is DiaryStateLoaded && state.diary.closed == 0)
Padding(
padding: const EdgeInsets.only(top: 12),