renderWidget function Null safety

dynamic renderWidget(
  1. List<StreamCollectFactory> renderList,
  2. [UpdateOptions? options]
)

Implementation

renderWidget(List<StreamCollectFactory> renderList, [UpdateOptions? options]) {
  Duration delay = _renderDelay;
  if (options != null && options.delay != null && options.delay is Duration) {
    _renderWidgetList.addAll(renderList);
    delay = options.delay as Duration;
    if (_renderTimer != null && _renderTimer.isActive) _renderTimer.cancel();
    _renderTimer = Timer(delay, () {
      _render(_renderWidgetList);
      _renderWidgetList.clear();
    });
  } else {
    _renderTimer = Timer(delay, () {
      _render(renderList);
    });
  }
}