toJson method
Implementation
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['friend_profile_identifier'] = userID;
data['friend_profile_remark'] = friendRemark;
data['friend_profile_group_name_array'] = friendGroups;
// C 接口已处理有无 "Tag_SNS_Custom_" 前缀的情况,此处不用处理。
if (friendCustomInfo != null && friendCustomInfo!.isNotEmpty) {
List<Map<String, dynamic>> customInfoList = Tools.map2JsonList(friendCustomInfo!, 'friend_profile_custom_string_info_key', 'friend_profile_custom_string_info_value');
data['friend_profile_custom_string_array'] = customInfoList;
}
if (userProfile != null) {
data['friend_profile_user_profile'] = userProfile!.toJson();
}
return data;
}