Browse Source

style(nextcloud): cleanup unnecessary cast

Signed-off-by: Nikolas Rimikis <rimikis.nikolas@gmail.com>
pull/592/head
Nikolas Rimikis 1 year ago
parent
commit
9d243580cb
No known key found for this signature in database
GPG Key ID: 85ED1DE9786A4FF2
  1. 5
      packages/nextcloud/lib/src/client.dart
  2. 4
      packages/nextcloud/lib/src/webdav/client.dart

5
packages/nextcloud/lib/src/client.dart

@ -27,10 +27,7 @@ class NextcloudClient extends DynamiteClient {
final String? userAgentOverride,
super.cookieJar,
}) : super(
baseHeaders: (<String, String?>{
'Accept-Language': language,
}..removeWhere((final _, final value) => value == null))
.cast<String, String>(),
baseHeaders: language != null ? {'Accept-Language': language} : null,
userAgent: userAgentOverride ?? appType.userAgent,
authentications: [
if (appPassword != null) ...[

4
packages/nextcloud/lib/src/webdav/client.dart

@ -103,8 +103,8 @@ class WebDavClient {
'OPTIONS',
_constructPath(),
);
final davCapabilities = response.headers['dav']?.cast<String>().first ?? '';
final davSearchCapabilities = response.headers['dasl']?.cast<String>().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(),

Loading…
Cancel
Save