V2TimFriendInfo.fromJson constructor

V2TimFriendInfo.fromJson(
  1. Map json
)

Implementation

V2TimFriendInfo.fromJson(Map json) {
  json = Utils.formatJson(json);
  userID = json['friend_profile_identifier'] ?? "";
  friendRemark = json['friend_profile_remark'];
  friendGroups = json['friend_profile_group_name_array']?.cast<String>();

  List<dynamic>? jsonList = json['friend_profile_custom_string_array'];
  if (jsonList != null && jsonList.isNotEmpty) {
    friendCustomInfo = Tools.jsonList2Map<String>(jsonList.whereType<Map<String, dynamic>>().toList(), 'friend_profile_custom_string_info_key', 'friend_profile_custom_string_info_value');
  }

  userProfile = json['friend_profile_user_profile'] != null
      ? V2TimUserFullInfo.fromJson(json['friend_profile_user_profile'])
      : null;
}