DownloadClientData constructor

DownloadClientData({
  1. required DateTime date_time_start,
  2. required File file,
  3. required Uri uri,
  4. required ByteStream byteStream,
  5. required Completer<bool> completer,
  6. required bool is_failed,
  7. required void onData(
    1. List<int> chunk
    ),
  8. required FutureOr<void> onDone(
    1. DownloadClientData downloadClientData
    ),
})

Implementation

DownloadClientData({
  required this.date_time_start,
  required this.file,
  required this.uri,
  required this.byteStream,
  required this.completer,
  required this.is_failed,
  required this.onData,
  required this.onDone,
}) {
  stream = byteStream.listen(
    onData,
    onDone: () async {
      await onDone(this);
    },
  );
}