saveUserInfo static method

Future<DataResult> saveUserInfo(
  1. String? nickname,
  2. String? signature,
  3. List<UserPic>? pic,
  4. String? birthday,
  5. String? country,
  6. String? gender,
)

保存用户信息

Implementation

static Future<DataResult> saveUserInfo(
    String? nickname,
    String? signature,
    List<UserPic>? pic,
    String? birthday,
    String? country,
    String? gender) async {
  Map other = {
    'nickname': nickname,
    'signature': signature,
    'pic': pic,
    'birthday': birthday,
    'country': country,
    'gender': gender
  };
  if (pic?.isEmpty == false) {
    other['headImage'] = pic?.first.url;
  }
  var res = await BaseDao.fromBaseEncrypt(other, Address.saveUserInfo());
  if (res.result) {
    var entity = UserEntity.fromJson(res.data);
    return DataResult(entity, true);
  }
  return res;
}