forked from eatvio/eatvio_app
fix(diary): added proccesing of future dates and fixed deleted portions
This commit is contained in:
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user