From 678ed004a3306822fe928a7b2a07867eef1ec044 Mon Sep 17 00:00:00 2001 From: jld3103 Date: Fri, 4 Aug 2023 10:24:07 +0200 Subject: [PATCH] fix(nextcloud,neon_files): Do not require client for toWebDavFiles --- packages/neon/neon_files/lib/blocs/browser.dart | 2 +- packages/nextcloud/lib/src/webdav/file.dart | 2 +- packages/nextcloud/test/webdav_test.dart | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/neon/neon_files/lib/blocs/browser.dart b/packages/neon/neon_files/lib/blocs/browser.dart index 933a1464..e3fff3f8 100644 --- a/packages/neon/neon_files/lib/blocs/browser.dart +++ b/packages/neon/neon_files/lib/blocs/browser.dart @@ -56,7 +56,7 @@ class FilesBrowserBloc extends InteractiveBloc implements FilesBrowserBlocEvents ), depth: '1', ), - (final response) => response.toWebDavFiles(client.webdav).sublist(1), + (final response) => response.toWebDavFiles().sublist(1), emitEmptyCache: true, ); } diff --git a/packages/nextcloud/lib/src/webdav/file.dart b/packages/nextcloud/lib/src/webdav/file.dart index 9ed5618f..a9cff423 100644 --- a/packages/nextcloud/lib/src/webdav/file.dart +++ b/packages/nextcloud/lib/src/webdav/file.dart @@ -5,7 +5,7 @@ import 'package:nextcloud/src/webdav/webdav.dart'; // ignore: public_member_api_docs extension WebDavMultistatusFile on WebDavMultistatus { /// Convert the [WebDavMultistatus] into a [WebDavFile] for easier handling - List toWebDavFiles(final WebDavClient client) => responses + List toWebDavFiles() => responses .where((final response) => response.href != null) .map((final response) => WebDavFile(response: response)) .toList(); diff --git a/packages/nextcloud/test/webdav_test.dart b/packages/nextcloud/test/webdav_test.dart index 2b18db32..13e466dc 100644 --- a/packages/nextcloud/test/webdav_test.dart +++ b/packages/nextcloud/test/webdav_test.dart @@ -85,7 +85,7 @@ void main() { ocmsharepermissions: true, ), )) - .toWebDavFiles(client.webdav) + .toWebDavFiles() .single; expect(response.path, '/Nextcloud.png'); @@ -150,7 +150,7 @@ void main() { ), depth: '0', )) - .toWebDavFiles(client.webdav) + .toWebDavFiles() .single; expect(response.path, '/test/');