|
|
@ -71,16 +71,20 @@ class _FilesBrowserViewState extends State<FilesBrowserView> { |
|
|
|
child: const Icon(Icons.add), |
|
|
|
child: const Icon(Icons.add), |
|
|
|
) |
|
|
|
) |
|
|
|
: null, |
|
|
|
: null, |
|
|
|
body: NeonListView<Widget>( |
|
|
|
body: SortBoxBuilder<FilesSortProperty, WebDavFile>( |
|
|
|
|
|
|
|
sortBox: filesSortBox, |
|
|
|
|
|
|
|
sortPropertyOption: widget.bloc.options.filesSortPropertyOption, |
|
|
|
|
|
|
|
sortBoxOrderOption: widget.bloc.options.filesSortBoxOrderOption, |
|
|
|
|
|
|
|
input: files.data, |
|
|
|
|
|
|
|
builder: (final context, final sorted) => NeonListView<Widget>( |
|
|
|
scrollKey: 'files-${pathSnapshot.data!.join('/')}', |
|
|
|
scrollKey: 'files-${pathSnapshot.data!.join('/')}', |
|
|
|
withFloatingActionButton: true, |
|
|
|
withFloatingActionButton: true, |
|
|
|
items: [ |
|
|
|
items: [ |
|
|
|
for (final uploadTask in files.data == null |
|
|
|
for (final uploadTask in sorted == null |
|
|
|
? <UploadTask>[] |
|
|
|
? <UploadTask>[] |
|
|
|
: uploadTasksSnapshot.data!.where( |
|
|
|
: uploadTasksSnapshot.data!.where( |
|
|
|
(final task) => files.data! |
|
|
|
(final task) => |
|
|
|
.where((final file) => _pathMatchesFile(task.path, file.name)) |
|
|
|
sorted.where((final file) => _pathMatchesFile(task.path, file.name)).isEmpty, |
|
|
|
.isEmpty, |
|
|
|
|
|
|
|
)) ...[ |
|
|
|
)) ...[ |
|
|
|
StreamBuilder<int>( |
|
|
|
StreamBuilder<int>( |
|
|
|
stream: uploadTask.progress, |
|
|
|
stream: uploadTask.progress, |
|
|
@ -104,8 +108,8 @@ class _FilesBrowserViewState extends State<FilesBrowserView> { |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
], |
|
|
|
], |
|
|
|
if (files.data != null) ...[ |
|
|
|
if (sorted != null) ...[ |
|
|
|
for (final file in files.data!) ...[ |
|
|
|
for (final file in sorted) ...[ |
|
|
|
if (!widget.onlyShowDirectories || file.isDirectory) ...[ |
|
|
|
if (!widget.onlyShowDirectories || file.isDirectory) ...[ |
|
|
|
Builder( |
|
|
|
Builder( |
|
|
|
builder: (final context) { |
|
|
|
builder: (final context) { |
|
|
@ -199,6 +203,7 @@ class _FilesBrowserViewState extends State<FilesBrowserView> { |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
|
|
|
|
), |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
bool _pathMatchesFile(final List<String> path, final String name) => const ListEquality().equals( |
|
|
|
bool _pathMatchesFile(final List<String> path, final String name) => const ListEquality().equals( |
|
|
|