toJson method
Implementation
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['user_profile_identifier'] = userID;
data['user_profile_nick_name'] = nickName;
data['user_profile_face_url'] = faceUrl;
data['user_profile_self_signature'] = selfSignature;
data['user_profile_gender'] = gender;
data['user_profile_add_permission'] = _convert2CFriendAddPermission(allowType ?? AllowType.V2TIM_FRIEND_ALLOW_ANY);
// C 接口已处理有无 "Tag_Profile_Custom_" 前缀的情况,此处不用处理。
if (customInfo != null && customInfo!.isNotEmpty) {
List<Map<String, dynamic>> customInfoList = Tools.map2JsonList(
customInfo!, 'user_profile_custom_string_info_key', 'user_profile_custom_string_info_value');
data['user_profile_custom_string_array'] = customInfoList;
}
data['user_profile_role'] = role;
data['user_profile_level'] = level;
data['user_profile_birthday'] = birthday;
return data;
}