controller method

ControllerTask controller(
  1. int tokenDownload
)

Implementation

ControllerTask controller(int tokenDownload) {
  SelectDownload selectDow = checkDownload(tokenDownload);
  if (!selectDow.exists || selectDow.status == null)
    ControllerTask(exists: false);

  TokenDownloadStatus status = selectDow.status!;
  SelectTask st = _selectIsolate(status.isolateToken);
  if (!st.exists) ControllerTask(exists: false);
  TaskDownload dw = st.task!;
  if (!dw.getStatus(tokenDownload)) ControllerTask(exists: false);
  return ControllerTask(exists: true, controller: dw.statusDownload.stream);
}