after rediense
This commit is contained in:
@@ -30,15 +30,16 @@ class ProfileBloc extends Bloc<ProfileEvent, ProfileState> {
|
||||
UpdateUserInfo event, Emitter<ProfileState> emit) async {
|
||||
emit(UpdateUserInfoLoading());
|
||||
try {
|
||||
await _userRepository.updateUserInfo(event.userId, event.picture, {
|
||||
'name': event.name,
|
||||
// 'picture': event.picture,
|
||||
'nickname': event.nickname,
|
||||
'email': event.email,
|
||||
'phone': event.phone,
|
||||
'birthDate': event.birthDate,
|
||||
'gender': event.gender
|
||||
});
|
||||
final userImageUrl = event.filePicture != null
|
||||
? await _userRepository.uploadPicture(
|
||||
event.filePicture!, event.myUser.id)
|
||||
: null;
|
||||
|
||||
final myUser = userImageUrl == null
|
||||
? event.myUser
|
||||
: event.myUser.copyWith(picture: userImageUrl);
|
||||
|
||||
await _userRepository.updateUserInfo(myUser);
|
||||
emit(const UpdateUserInfoSuccess());
|
||||
} catch (e) {
|
||||
emit(UpdateUserInfoFailure());
|
||||
|
||||
Reference in New Issue
Block a user