This commit is contained in:
2026-04-09 15:47:59 +01:00
parent 2033ad79e2
commit 558a28d12b
22 changed files with 1275 additions and 271 deletions
+19
View File
@@ -0,0 +1,19 @@
import 'package:nextcloud/nextcloud.dart';
class ServerDetails {
String name;
String description;
ServerDetails({
required this.name,
required this.description,
});
factory ServerDetails.fromTheme(Map _themeValues) {
//
DynamiteResponse icon = _themeValues['icon'];
DynamiteResponse theme = _themeValues['systemtheme'];
return ServerDetails(name: '', description: '');
}
}
+53
View File
@@ -0,0 +1,53 @@
import 'package:nextcloud/webdav.dart';
class Files {
String? path;
String? name;
String? resourceType;
String? contentType;
DateTime? creationDate;
DateTime? modifiedDate;
int? size;
Files({
required this.path,
required this.name,
required this.resourceType,
required this.contentType,
required this.creationDate,
required this.modifiedDate,
required this.size,
});
factory Files.fromWebDavResponse(WebDavResponse _response) {
//
var _name;
var _resourceType;
var _size;
var _tempPath = _response.href!.split("/");
var _length = _tempPath.length;
var _collection = _response.propstats[0].prop.davResourcetype!.collection;
if (_collection == null) {
_resourceType = 'file';
_name = _tempPath[_length - 1];
_size = _response.propstats[0].prop.davGetcontentlength;
} else {
_resourceType = 'folder';
_name = _tempPath[_length - 2].contains("dav")
? ".."
: _tempPath[_length - 2];
_size = _response.propstats[0].prop.davQuotaUsedBytes;
}
return Files(
path: _response.href ?? '',
name: Uri.decodeFull(_name),
contentType: _response.propstats[0].prop.davGetcontenttype ?? '',
creationDate: DateTime.now(),
modifiedDate: _response.propstats[0].prop.davGetlastmodified,
size: _size,
resourceType: _resourceType,
);
}
}