generateNativeUserInfoByDartParam static method

Map<String, dynamic> generateNativeUserInfoByDartParam(
  1. V2TimUserFullInfo info
)

Implementation

static Map<String, dynamic> generateNativeUserInfoByDartParam(V2TimUserFullInfo info) {
  List<Map<String, dynamic>> user_profile_item_custom_string_array = List.empty(growable: true);
  if (info.customInfo != null) {
    info.customInfo!.forEach((key, value) {
      user_profile_item_custom_string_array.add(Map<String, dynamic>.from({
        "user_profile_custom_string_info_key": key,
        "user_profile_custom_string_info_value": value,
      }));
    });
  }
  Map<String, dynamic> res = Map<String, dynamic>.from({
    "user_profile_item_nick_name": info.nickName,
    "user_profile_item_gender": info.gender,
    "user_profile_item_face_url": info.faceUrl,
    "user_profile_item_self_signature": info.selfSignature,
    "user_profile_item_add_permission": info.allowType,
    "user_profile_item_birthday": info.birthday,
    "user_profile_item_level": info.level,
    "user_profile_item_role": info.role,
    "user_profile_item_custom_string_array": user_profile_item_custom_string_array.isNotEmpty ? user_profile_item_custom_string_array : null,
  });
  return res;
}