fixed profile, recipeis and diets

This commit is contained in:
Username1548
2025-02-10 21:50:13 +07:00
parent 5ea3264474
commit 070d7e1047
51 changed files with 1382 additions and 1360 deletions

View File

@@ -1,3 +1,5 @@
import 'dart:developer';
import 'package:eatvio_app/features/feed/presentation/bloc/consultants_cubit/consultants_state.dart';
import 'package:eatvio_app/features/feed/repositories/feed_repository.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
@@ -18,7 +20,8 @@ class ConsultantsCubit extends Cubit<ConsultantsState> {
isLoading: false,
),
);
} catch (e) {
} catch (e, st) {
log(e.toString(), stackTrace: st);
emit(ConsultantsState.error(errorMessage: e.toString()));
}
}

View File

@@ -107,9 +107,10 @@ class DietsCubit extends Cubit<DietsState> {
errorMessage: null,
),
);
} catch (e) {
} catch (e, st) {
log(e.toString(), stackTrace: st);
emit(
state.copyWith(errorMessage: e.toString()),
state.copyWith(isLoading: false),
);
}
}
@@ -143,14 +144,13 @@ class DietsCubit extends Cubit<DietsState> {
);
}
} catch (e) {
emit(state.copyWith(errorMessage: e.toString()));
emit(state.copyWith(isLoading: false));
}
}
}
Future<void> likeDiet(int id, int index) async {
final currentDiets = state.dietsList;
// if (currentDiets.isEmpty) return;
final currentDiets = state.dietsList;
final dietsForModification = [...currentDiets];
final currentDiet = currentDiets[index];
if (currentDiet.wasLikedByMe) {