forked from eatvio/eatvio_app
updated error handling, consultant rating layout and complaining logic
This commit is contained in:
@@ -110,7 +110,7 @@ class DietsCubit extends Cubit<DietsState> {
|
||||
} catch (e, st) {
|
||||
log(e.toString(), stackTrace: st);
|
||||
emit(
|
||||
state.copyWith(isLoading: false),
|
||||
state.copyWith(isLoading: false, errorMessage: e.toString()),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -144,13 +144,15 @@ class DietsCubit extends Cubit<DietsState> {
|
||||
);
|
||||
}
|
||||
} catch (e) {
|
||||
emit(state.copyWith(isLoading: false));
|
||||
emit(
|
||||
state.copyWith(isLoading: false, errorMessage: e.toString()),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> likeDiet(int id, int index) async {
|
||||
final currentDiets = state.dietsList;
|
||||
final currentDiets = state.dietsList;
|
||||
final dietsForModification = [...currentDiets];
|
||||
final currentDiet = currentDiets[index];
|
||||
if (currentDiet.wasLikedByMe) {
|
||||
|
||||
Reference in New Issue
Block a user