getMulitiMessageFileUrl static method

String getMulitiMessageFileUrl(
  1. Map<String, dynamic> elem,
  2. int image_type,
  3. bool isSnap
)

Implementation

static String getMulitiMessageFileUrl(
  Map<String, dynamic> elem,
  int image_type,
  bool isSnap,
) {
  int elem_type = elem["elem_type"] ?? 0;
  String ext = "";
  if (elem_type == 1) {
    if (image_type == 0) {
      ext = elem["image_elem_orig_url"] ?? "";
    } else if (image_type == 1) {
      ext = elem["image_elem_thumb_url"] ?? "";
    } else {
      ext = elem["image_elem_large_url"] ?? "";
    }
  } else if (elem_type == 2) {
    // 声音
    ext = elem["sound_elem_url"] ?? "";
  } else if (elem_type == 4) {
    // file
    ext = elem["file_elem_url"] ?? "";
  } else if (elem_type == 9) {
    if (isSnap) {
      ext = elem["video_elem_image_url"] ?? "";
    } else {
      ext = elem["video_elem_video_url"] ?? "";
    }
    // 视频
  }
  return ext;
}