From 9d243580cb8cde21a2264d2e1bde4b17535dc4cb Mon Sep 17 00:00:00 2001 From: Nikolas Rimikis Date: Thu, 24 Aug 2023 22:08:31 +0200 Subject: [PATCH] style(nextcloud): cleanup unnecessary cast Signed-off-by: Nikolas Rimikis --- packages/nextcloud/lib/src/client.dart | 5 +---- packages/nextcloud/lib/src/webdav/client.dart | 4 ++-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/packages/nextcloud/lib/src/client.dart b/packages/nextcloud/lib/src/client.dart index 278c47be..f3fb95be 100644 --- a/packages/nextcloud/lib/src/client.dart +++ b/packages/nextcloud/lib/src/client.dart @@ -27,10 +27,7 @@ class NextcloudClient extends DynamiteClient { final String? userAgentOverride, super.cookieJar, }) : super( - baseHeaders: ({ - 'Accept-Language': language, - }..removeWhere((final _, final value) => value == null)) - .cast(), + baseHeaders: language != null ? {'Accept-Language': language} : null, userAgent: userAgentOverride ?? appType.userAgent, authentications: [ if (appPassword != null) ...[ diff --git a/packages/nextcloud/lib/src/webdav/client.dart b/packages/nextcloud/lib/src/webdav/client.dart index 9f98a966..b08d4dfd 100644 --- a/packages/nextcloud/lib/src/webdav/client.dart +++ b/packages/nextcloud/lib/src/webdav/client.dart @@ -103,8 +103,8 @@ class WebDavClient { 'OPTIONS', _constructPath(), ); - final davCapabilities = response.headers['dav']?.cast().first ?? ''; - final davSearchCapabilities = response.headers['dasl']?.cast().first ?? ''; + final davCapabilities = response.headers['dav']?.first ?? ''; + final davSearchCapabilities = response.headers['dasl']?.first ?? ''; return WebDavOptions( davCapabilities.split(',').map((final e) => e.trim()).where((final e) => e.isNotEmpty).toSet(), davSearchCapabilities.split(',').map((final e) => e.trim()).where((final e) => e.isNotEmpty).toSet(),