cancel method

Future<bool> cancel({
  1. required int token,
})

Implementation

Future<bool> cancel({required int token}) async {
  SelectTask st = _select(token);
  if (st.exists) {
    TaskDownload dw = st.task!;
    dw.sendPortIsolate().send(ManMessagePort(action: 'stop'));
    return true;
  } else {
    return false;
  }
}