forked from eatvio/eatvio_app
fix: fixed analyzer issues and merge conflicts
This commit is contained in:
@@ -55,7 +55,7 @@ class DiaryCubit extends Cubit<DiaryState> {
|
||||
return null;
|
||||
}
|
||||
|
||||
setSelectedMeal(int meal) {
|
||||
void setSelectedMeal(int meal) {
|
||||
selectedMeal = meal;
|
||||
final currentState = state;
|
||||
if (currentState is DiaryStateLoaded) {
|
||||
@@ -154,7 +154,7 @@ class DiaryCubit extends Cubit<DiaryState> {
|
||||
return false;
|
||||
}
|
||||
|
||||
fetchDiary([bool needLoading = false, int? diaryId, int? currentDay]) async {
|
||||
Future<void> fetchDiary([bool needLoading = false, int? diaryId, int? currentDay]) async {
|
||||
this.diaryId ??= diaryId;
|
||||
|
||||
if (needLoading) {
|
||||
@@ -215,7 +215,7 @@ class DiaryCubit extends Cubit<DiaryState> {
|
||||
}
|
||||
}
|
||||
|
||||
finishDiaryDay({
|
||||
Future<void> finishDiaryDay({
|
||||
required int diaryId,
|
||||
required String wakeUp,
|
||||
required String retire,
|
||||
@@ -233,7 +233,7 @@ class DiaryCubit extends Cubit<DiaryState> {
|
||||
return (await diaryRepository.getNutritionData(index));
|
||||
}
|
||||
|
||||
addProductToMeal({
|
||||
Future<void> addProductToMeal({
|
||||
required int diaryId,
|
||||
required int mealId,
|
||||
required String productName,
|
||||
@@ -252,7 +252,7 @@ class DiaryCubit extends Cubit<DiaryState> {
|
||||
await fetchDiary();
|
||||
}
|
||||
|
||||
updateProductInMeal({
|
||||
Future<void> updateProductInMeal({
|
||||
required int diaryId,
|
||||
required int mealId,
|
||||
required int portionId,
|
||||
@@ -286,22 +286,22 @@ class DiaryCubit extends Cubit<DiaryState> {
|
||||
await fetchDiary();
|
||||
}
|
||||
|
||||
markEaten({required int diaryId, required int mealId, required int portionId}) async {
|
||||
Future<void> markEaten({required int diaryId, required int mealId, required int portionId}) async {
|
||||
await diaryRepository.markEaten(diaryId: diaryId, mealId: mealId, portionId: portionId);
|
||||
await fetchDiary();
|
||||
}
|
||||
|
||||
unmarkEaten({required int diaryId, required int mealId, required int portionId}) async {
|
||||
Future<void> unmarkEaten({required int diaryId, required int mealId, required int portionId}) async {
|
||||
await diaryRepository.unmarkEaten(diaryId: diaryId, mealId: mealId, portionId: portionId);
|
||||
await fetchDiary();
|
||||
}
|
||||
|
||||
restore({required int diaryId, required int mealId, required int portionId}) async {
|
||||
Future<void> restore({required int diaryId, required int mealId, required int portionId}) async {
|
||||
await diaryRepository.restore(diaryId: diaryId, mealId: mealId, portionId: portionId);
|
||||
await fetchDiary();
|
||||
}
|
||||
|
||||
deleteProductFromMeal({required int diaryId, required int mealId, required int portionId}) async {
|
||||
Future<void> deleteProductFromMeal({required int diaryId, required int mealId, required int portionId}) async {
|
||||
await diaryRepository.deleteProductFromMeal(diaryId: diaryId, mealId: mealId, portionId: portionId);
|
||||
await fetchDiary();
|
||||
}
|
||||
@@ -310,12 +310,12 @@ class DiaryCubit extends Cubit<DiaryState> {
|
||||
return await glossaryRepository.getGlossaryListByQuery(query);
|
||||
}
|
||||
|
||||
uploadPhotos({required List<File> files, required int diaryId}) async {
|
||||
Future<void> uploadPhotos({required List<File> files, required int diaryId}) async {
|
||||
await diaryRepository.uploadPhotos(files: await ImageCompressUtility.compressFilesList(files), diaryId: diaryId, mealId: selectedMeal);
|
||||
await fetchDiary();
|
||||
}
|
||||
|
||||
deletePhoto({required DiaryPhotoModel photo, required int diaryId}) async {
|
||||
Future<void> deletePhoto({required DiaryPhotoModel photo, required int diaryId}) async {
|
||||
await diaryRepository.deletePhoto(photo: photo, diaryId: diaryId, mealId: selectedMeal);
|
||||
await fetchDiary();
|
||||
}
|
||||
@@ -335,32 +335,32 @@ class DiaryCubit extends Cubit<DiaryState> {
|
||||
return null;
|
||||
}
|
||||
|
||||
fillTime({required int diaryId, required String time}) async {
|
||||
Future<void> fillTime({required int diaryId, required String time}) async {
|
||||
await diaryRepository.fillTime(diaryId: diaryId, mealId: selectedMeal, time: time);
|
||||
await fetchDiary();
|
||||
}
|
||||
|
||||
fillWakeup({required int diaryId, required String time}) async {
|
||||
Future<void> fillWakeup({required int diaryId, required String time}) async {
|
||||
await diaryRepository.fillWakeup(diaryId: diaryId, time: time);
|
||||
await fetchDiary();
|
||||
}
|
||||
|
||||
fillRetire({required int diaryId, required String time}) async {
|
||||
Future<void> fillRetire({required int diaryId, required String time}) async {
|
||||
await diaryRepository.fillRetire(diaryId: diaryId, time: time);
|
||||
await fetchDiary();
|
||||
}
|
||||
|
||||
fillSatiety({required int diaryId, required int satiety}) async {
|
||||
Future<void> fillSatiety({required int diaryId, required int satiety}) async {
|
||||
await diaryRepository.fillSatiety(diaryId: diaryId, mealId: selectedMeal, satiety: satiety);
|
||||
await fetchDiary();
|
||||
}
|
||||
|
||||
fillMood({required int diaryId, required int mood}) async {
|
||||
Future<void> fillMood({required int diaryId, required int mood}) async {
|
||||
await diaryRepository.fillMood(diaryId: diaryId, mealId: selectedMeal, mood: mood);
|
||||
await fetchDiary();
|
||||
}
|
||||
|
||||
fillComment(String comment) {
|
||||
void fillComment(String comment) {
|
||||
this.comment = comment;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user