updated project linter-rules and enforced them
This commit is contained in:
@ -24,7 +24,7 @@ class CacheableFile {
|
||||
CacheableFile.fromDavFile(WebDavFile file) {
|
||||
path = file.path.path;
|
||||
isDirectory = file.isDirectory;
|
||||
name = file.isDirectory ? file.name : file.path.path.split("/").last;
|
||||
name = file.isDirectory ? file.name : file.path.path.split('/').last;
|
||||
mimeType = file.mimeType;
|
||||
size = file.size;
|
||||
eTag = file.etag;
|
||||
|
@ -14,7 +14,7 @@ class ListFiles extends WebdavApi<ListFilesParams> {
|
||||
@override
|
||||
Future<ListFilesResponse> run() async {
|
||||
List<WebDavFile> davFiles = (await (await WebdavApi.webdav).propfind(PathUri.parse(params.path))).toWebDavFiles();
|
||||
Set<CacheableFile> files = davFiles.map((e) => CacheableFile.fromDavFile(e)).toSet();
|
||||
Set<CacheableFile> files = davFiles.map(CacheableFile.fromDavFile).toSet();
|
||||
|
||||
// webdav handles subdirectories wrong, this is a fix
|
||||
// currently this fix is not needed anymore
|
||||
@ -26,7 +26,7 @@ class ListFiles extends WebdavApi<ListFilesParams> {
|
||||
// }
|
||||
|
||||
// somehow the current working folder is also listed, it is filtered here.
|
||||
files.removeWhere((element) => element.path == "/${params.path}/" || element.path == "/");
|
||||
files.removeWhere((element) => element.path == '/${params.path}/' || element.path == '/');
|
||||
|
||||
return ListFilesResponse(files);
|
||||
}
|
||||
|
@ -10,9 +10,9 @@ class ListFilesCache extends RequestCache<ListFilesResponse> {
|
||||
String path;
|
||||
|
||||
ListFilesCache({required onUpdate, required this.path}) : super(RequestCache.cacheNothing, onUpdate) {
|
||||
var bytes = utf8.encode("MarianumMobile-$path");
|
||||
var bytes = utf8.encode('MarianumMobile-$path');
|
||||
String cacheName = md5.convert(bytes).toString();
|
||||
start("MarianumMobile", "wd-folder-$cacheName");
|
||||
start('MarianumMobile', 'wd-folder-$cacheName');
|
||||
}
|
||||
|
||||
@override
|
||||
|
@ -35,7 +35,7 @@ class ListFilesResponse extends ApiResponse {
|
||||
|
||||
switch(sortOption) {
|
||||
case SortOption.date:
|
||||
buffer.write(Jiffy.parseFromMillisecondsSinceEpoch(file.modifiedAt?.millisecondsSinceEpoch ?? 0).format(pattern: "yyyyMMddhhmmss"));
|
||||
buffer.write(Jiffy.parseFromMillisecondsSinceEpoch(file.modifiedAt?.millisecondsSinceEpoch ?? 0).format(pattern: 'yyyyMMddhhmmss'));
|
||||
break;
|
||||
|
||||
case SortOption.name:
|
||||
|
Reference in New Issue
Block a user