addAllDanmu method

bool addAllDanmu(
  1. Iterable<T> models
)

传入的列表最好按照时间顺序排序

Implementation

bool addAllDanmu(Iterable<T> models) {
  assert(isEnable);
  bool result = false;
  for (var model in models) {
    bool t = _addEntry(model);
    if(t){
      result = true;
    }
    if (danmuItems.length > maxSize) {
      return result;
    }
  }
  if (danmuItems.isNotEmpty && isAnimating && _status == DanmuStatus.idle) {
    _status = _idleBeforeStatus;
    _checkStatusChanged();
  }
  return result;
}