dispatch method

void dispatch(
  1. BarrageLineController ctrl,
  2. List<BarrageItem> value,
  3. int channelIndex,
  4. double slideWidth,
)

Implementation

void dispatch(BarrageLineController ctrl, List<BarrageItem> value, int channelIndex, double slideWidth) {
  if (widget.channelDelayMap != null) {
    Duration? duration = widget.channelDelayMap![channelIndex];
    if (duration != null) {
      Future.delayed(duration, () {
        ctrl.trigger(value, slideWidth);
      });
    } else {
      _randTrigger(ctrl, value, slideWidth);
    }
  } else {
    _randTrigger(ctrl, value, slideWidth);
  }
}