feat(profile): add button for weight and circumferences

This commit is contained in:
mso7nueh
2024-09-04 11:51:03 +03:00
parent d519c505e7
commit 0316ea9228
10 changed files with 385 additions and 153 deletions

View File

@@ -45,6 +45,12 @@ class ProfileCubit extends Cubit<ProfileState> {
waistCircumference: waistCircumference,
hipCircumference: hipCircumference,
);
emit(
ProfileState.loaded(
profile: await profileRepository.getMyProfile(),
blogPosts: (state as ProfileStateLoaded).blogPosts,
),
);
} catch (e) {
emit(ProfileState.error(errorMessage: e.toString()));
print(e);
@@ -52,12 +58,18 @@ class ProfileCubit extends Cubit<ProfileState> {
}
addWeight({
required int weight,
required double weight,
}) async {
try {
await profileRepository.addWeight(
weight: weight,
);
emit(
ProfileState.loaded(
profile: await profileRepository.getMyProfile(),
blogPosts: (state as ProfileStateLoaded).blogPosts,
),
);
} catch (e) {
emit(ProfileState.error(errorMessage: e.toString()));
print(e);