getImageFromImgList static method

V2TimImage? getImageFromImgList(
  1. List<V2TimImage?>? list,
  2. List<String> order
)

Implementation

static V2TimImage? getImageFromImgList(
    List<V2TimImage?>? list, List<String> order) {
  V2TimImage? img;
  try {
    for (String type in order) {
      img = list?.firstWhere(
              (e) =>
          e?.type == HistoryMessageDartConstant.V2_TIM_IMAGE_TYPES[type],
          orElse: () => null);
    }
  } catch (e) {
    outputLogger.i('getImageFromImgList error ${e.toString()}');
  }
  return img;
}