addNotification static method

void addNotification(
  1. DownloadTask task
)

Implementation

static void addNotification(DownloadTask task) {
  assert(_isInit, 'NotificationManager not initialized');
  assert(_notificationMap[task.downloadId] == null, 'Notification already added');
  listener(DownloadTask task) {
    _updateNotification(task);
  }
  _notificationMap[task.downloadId] = listener;
  task.addListener(listener);
}