state property

DownloadState get state

The state of the task.

Implementation

DownloadState get state => switch (_phase) {
  _Phase.running ||
  _Phase.pausing ||
  _Phase.canceling => DownloadState.running,
  _Phase.paused => DownloadState.paused,
  _Phase.success => DownloadState.success,
  _Phase.canceled => DownloadState.canceled,
  _Phase.error => DownloadState.error,
};