sendChannelMapBarrage method

void sendChannelMapBarrage(
  1. HashMap<int, List<BarrageItem>>? channelMapItems
)

Implementation

void sendChannelMapBarrage(HashMap<int, List<BarrageItem>>? channelMapItems) {
  if (channelMapItems != null) {
    clearCache();
    totalMapBarrageItems.addAll(channelMapItems);
    double totalWidth = 0;
    double originmaxW = 0;
    totalMapBarrageItems.forEach((key, value) {
      double totalW = 0;
      for (var element in value) {
        originmaxW = max(originmaxW, element.itemWidth);
        totalW += element.itemWidth;
      }
      totalWidth = max(totalWidth, totalW);
    });
    slideWidth = totalWidth;

    value = BarrageItemValue(mapItems: totalMapBarrageItems, slideWidth: slideWidth);
  }
}