diff --git a/packages/nextcloud/lib/src/webdav/client.dart b/packages/nextcloud/lib/src/webdav/client.dart index fa05a74a..88a10b53 100644 --- a/packages/nextcloud/lib/src/webdav/client.dart +++ b/packages/nextcloud/lib/src/webdav/client.dart @@ -187,7 +187,7 @@ class WebDavClient { return putStream( file.openRead().map((final chunk) { uploaded += chunk.length; - onProgress?.call(uploaded / fileStat.size * 100); + onProgress?.call(uploaded / fileStat.size); return Uint8List.fromList(chunk); }), path, @@ -221,7 +221,7 @@ class WebDavClient { response.listen((final chunk) async { sink.add(chunk); downloaded += chunk.length; - onProgress?.call(downloaded / response.contentLength * 100); + onProgress?.call(downloaded / response.contentLength); if (downloaded >= response.contentLength) { completer.complete(); } diff --git a/packages/nextcloud/test/webdav_test.dart b/packages/nextcloud/test/webdav_test.dart index ef7391ec..bf6ac30b 100644 --- a/packages/nextcloud/test/webdav_test.dart +++ b/packages/nextcloud/test/webdav_test.dart @@ -301,7 +301,7 @@ void main() { destination, onProgress: progressValues.add, ); - expect(progressValues, containsAll([100.0, 100.0])); + expect(progressValues, containsAll([1.0, 1.0])); expect(destination.readAsBytesSync(), source.readAsBytesSync()); destinationDir.deleteSync(recursive: true);