part of '../neon_files.dart'; class UploadTask { UploadTask({ required this.path, required this.size, required this.lastModified, }); final List path; final int size; final DateTime lastModified; final _streamController = StreamController(); late final progress = _streamController.stream.asBroadcastStream(); Future execute(final NextcloudClient client, final Stream> stream) async { var uploaded = 0; await client.webdav.putStream( stream.map((final chunk) { uploaded += chunk.length; _streamController.add((uploaded / size * 100).toInt()); return Uint8List.fromList(chunk); }), path.join('/'), lastModified: lastModified, ); } }