feat(notifications): added navigation from different types of notifications

This commit is contained in:
misha
2026-02-18 19:45:32 +03:00
parent bb97c395dd
commit c540cbe6df
13 changed files with 974 additions and 507 deletions

View File

@@ -48,6 +48,11 @@ class DiaryCubit extends Cubit<DiaryState> {
String comment = '';
void setInitialDate(DateTime? date) {
if (date == null) return;
selectedDay = date;
}
Future<bool> setSelectedDay(DateTime day) async {
final prevDay = selectedDay;
final prevMeal = selectedMeal;
@@ -63,7 +68,7 @@ class DiaryCubit extends Cubit<DiaryState> {
return canSelect;
}
Future<bool> fetchDiaryV2({bool needLoading = false, int? diaryId}) async {
Future<bool> fetchDiaryV2({bool needLoading = false, int? diaryId, DateTime? date}) async {
final currentState = state;
try {
if (needLoading) {
@@ -77,6 +82,7 @@ class DiaryCubit extends Cubit<DiaryState> {
return true;
}
}
final diaryDay = await getDiary();
if (diaryDay == null) {
emit(const DiaryState.error(errorMessage: 'Diary not found'));