forked from eatvio/eatvio_app
feat(profile): add button for weight and circumferences
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user