start method

DownloadProgressSession start({
  1. String label = '',
  2. int stepCount = 3,
  3. String? key,
})

Implementation

DownloadProgressSession start({
  String label = '',
  int stepCount = 3,
  String? key,
}) {
  final active = _active;
  if (key != null && active != null && _activeKey == key) {
    return active;
  }
  _lastFinished?.dispose();
  _lastFinished = null;
  _active?.dispose();
  final session = DownloadProgressSession(
    initialLabel: label,
    stepCount: stepCount,
  );
  _active = session;
  _activeKey = key;
  revision.value++;
  return session;
}