forked from eatvio/eatvio_app
feat(chats): added refresh timer for chat room, feat(diary): fixed plan duration in plan widget and added date to app bar)
This commit is contained in:
@@ -151,7 +151,7 @@ class DiaryCubit extends Cubit<DiaryState> {
|
||||
return false;
|
||||
}
|
||||
|
||||
fetchDiary([bool needLoading = false, int? diaryId]) async {
|
||||
fetchDiary([bool needLoading = false, int? diaryId, int? currentDay]) async {
|
||||
this.diaryId ??= diaryId;
|
||||
|
||||
if (needLoading) {
|
||||
@@ -175,7 +175,7 @@ class DiaryCubit extends Cubit<DiaryState> {
|
||||
final chosenPlanModel = await chatRepository.getChosenPlan(id: diaryDay.chosenPlanId!);
|
||||
planDuration = chosenPlanModel.plan.duration;
|
||||
planName = chosenPlanModel.plan.name;
|
||||
currentPlanDay = DateTime.now().difference(chosenPlanModel.startDate).inDays + 1;
|
||||
currentPlanDay = currentDay ?? DateTime.now().difference(chosenPlanModel.startDate).inDays + 1;
|
||||
}
|
||||
final nutrition = await getNutrition(diaryDay.id);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user