updateProfile method

Future<bool> updateProfile(
  1. ProfileUpdate update
)

Implementation

Future<bool> updateProfile(ProfileUpdate update) async {
  state = state.copyWith(isLoading: true);
  try {
    final updated = await _service.updateMe(update);
    state = state.copyWith(user: updated, isLoading: false);
    return true;
  } catch (e) {
    state = state.copyWith(isLoading: false, error: e.toString());
    return false;
  }
}