|
|
@ -75,15 +75,8 @@ class _FilesBrowserViewState extends State<FilesBrowserView> { |
|
|
|
? const SizedBox() |
|
|
|
? const SizedBox() |
|
|
|
: FileListTile( |
|
|
|
: FileListTile( |
|
|
|
context: context, |
|
|
|
context: context, |
|
|
|
details: FileDetails( |
|
|
|
details: FileDetails.fromUploadTask( |
|
|
|
path: uploadTask.path, |
|
|
|
task: uploadTask, |
|
|
|
isDirectory: false, |
|
|
|
|
|
|
|
size: uploadTask.size, |
|
|
|
|
|
|
|
etag: null, |
|
|
|
|
|
|
|
mimeType: null, |
|
|
|
|
|
|
|
lastModified: uploadTask.lastModified, |
|
|
|
|
|
|
|
hasPreview: null, |
|
|
|
|
|
|
|
isFavorite: null, |
|
|
|
|
|
|
|
), |
|
|
|
), |
|
|
|
uploadProgress: uploadTaskProgressSnapshot.data, |
|
|
|
uploadProgress: uploadTaskProgressSnapshot.data, |
|
|
|
downloadProgress: null, |
|
|
|
downloadProgress: null, |
|
|
@ -110,27 +103,26 @@ class _FilesBrowserViewState extends State<FilesBrowserView> { |
|
|
|
stream: matchingDownloadTasks.isNotEmpty |
|
|
|
stream: matchingDownloadTasks.isNotEmpty |
|
|
|
? matchingDownloadTasks.first.progress |
|
|
|
? matchingDownloadTasks.first.progress |
|
|
|
: null, |
|
|
|
: null, |
|
|
|
builder: (final context, final downloadTaskProgressSnapshot) => FileListTile( |
|
|
|
builder: (final context, final downloadTaskProgressSnapshot) { |
|
|
|
|
|
|
|
final path = widget.bloc.path.value; |
|
|
|
|
|
|
|
final details = matchingUploadTasks.isEmpty |
|
|
|
|
|
|
|
? FileDetails.fromWebDav( |
|
|
|
|
|
|
|
file: file, |
|
|
|
|
|
|
|
path: path, |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
: FileDetails.fromUploadTask( |
|
|
|
|
|
|
|
task: matchingUploadTasks.first, |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return FileListTile( |
|
|
|
context: context, |
|
|
|
context: context, |
|
|
|
details: FileDetails( |
|
|
|
details: details, |
|
|
|
path: [...widget.bloc.path.value, file.name], |
|
|
|
|
|
|
|
isDirectory: matchingUploadTasks.isEmpty && file.isDirectory, |
|
|
|
|
|
|
|
size: matchingUploadTasks.isNotEmpty |
|
|
|
|
|
|
|
? matchingUploadTasks.first.size |
|
|
|
|
|
|
|
: file.size, |
|
|
|
|
|
|
|
etag: matchingUploadTasks.isNotEmpty ? null : file.etag, |
|
|
|
|
|
|
|
mimeType: matchingUploadTasks.isNotEmpty ? null : file.mimeType, |
|
|
|
|
|
|
|
lastModified: matchingUploadTasks.isNotEmpty |
|
|
|
|
|
|
|
? matchingUploadTasks.first.lastModified |
|
|
|
|
|
|
|
: file.lastModified, |
|
|
|
|
|
|
|
hasPreview: matchingUploadTasks.isNotEmpty ? null : file.hasPreview, |
|
|
|
|
|
|
|
isFavorite: matchingUploadTasks.isNotEmpty ? null : file.favorite, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
uploadProgress: uploadTaskProgressSnapshot.data, |
|
|
|
uploadProgress: uploadTaskProgressSnapshot.data, |
|
|
|
downloadProgress: downloadTaskProgressSnapshot.data, |
|
|
|
downloadProgress: downloadTaskProgressSnapshot.data, |
|
|
|
enableFileActions: widget.enableFileActions, |
|
|
|
enableFileActions: widget.enableFileActions, |
|
|
|
onPickFile: widget.onPickFile, |
|
|
|
onPickFile: widget.onPickFile, |
|
|
|
), |
|
|
|
); |
|
|
|
|
|
|
|
}, |
|
|
|
), |
|
|
|
), |
|
|
|
); |
|
|
|
); |
|
|
|
}, |
|
|
|
}, |
|
|
|