|
|
@ -46,7 +46,7 @@ class _FilesBrowserViewState extends State<FilesBrowserView> { |
|
|
|
? Container() |
|
|
|
? Container() |
|
|
|
: BackButtonListener( |
|
|
|
: BackButtonListener( |
|
|
|
onBackButtonPressed: () async { |
|
|
|
onBackButtonPressed: () async { |
|
|
|
final path = pathSnapshot.data!; |
|
|
|
final path = pathSnapshot.requireData; |
|
|
|
if (path.isNotEmpty) { |
|
|
|
if (path.isNotEmpty) { |
|
|
|
widget.bloc.setPath(path.sublist(0, path.length - 1)); |
|
|
|
widget.bloc.setPath(path.sublist(0, path.length - 1)); |
|
|
|
return true; |
|
|
|
return true; |
|
|
@ -59,12 +59,12 @@ class _FilesBrowserViewState extends State<FilesBrowserView> { |
|
|
|
sortBoxOrderOption: widget.bloc.options.filesSortBoxOrderOption, |
|
|
|
sortBoxOrderOption: widget.bloc.options.filesSortBoxOrderOption, |
|
|
|
input: files.data, |
|
|
|
input: files.data, |
|
|
|
builder: (final context, final sorted) => NeonListView<Widget>( |
|
|
|
builder: (final context, final sorted) => NeonListView<Widget>( |
|
|
|
scrollKey: 'files-${pathSnapshot.data!.join('/')}', |
|
|
|
scrollKey: 'files-${pathSnapshot.requireData.join('/')}', |
|
|
|
withFloatingActionButton: true, |
|
|
|
withFloatingActionButton: true, |
|
|
|
items: [ |
|
|
|
items: [ |
|
|
|
for (final uploadTask in sorted == null |
|
|
|
for (final uploadTask in sorted == null |
|
|
|
? <UploadTask>[] |
|
|
|
? <UploadTask>[] |
|
|
|
: uploadTasksSnapshot.data!.where( |
|
|
|
: uploadTasksSnapshot.requireData.where( |
|
|
|
(final task) => |
|
|
|
(final task) => |
|
|
|
sorted.where((final file) => _pathMatchesFile(task.path, file.name)).isEmpty, |
|
|
|
sorted.where((final file) => _pathMatchesFile(task.path, file.name)).isEmpty, |
|
|
|
)) ...[ |
|
|
|
)) ...[ |
|
|
@ -95,9 +95,9 @@ class _FilesBrowserViewState extends State<FilesBrowserView> { |
|
|
|
if (!widget.onlyShowDirectories || file.isDirectory) ...[ |
|
|
|
if (!widget.onlyShowDirectories || file.isDirectory) ...[ |
|
|
|
Builder( |
|
|
|
Builder( |
|
|
|
builder: (final context) { |
|
|
|
builder: (final context) { |
|
|
|
final matchingUploadTasks = uploadTasksSnapshot.data! |
|
|
|
final matchingUploadTasks = uploadTasksSnapshot.requireData |
|
|
|
.where((final task) => _pathMatchesFile(task.path, file.name)); |
|
|
|
.where((final task) => _pathMatchesFile(task.path, file.name)); |
|
|
|
final matchingDownloadTasks = downloadTasksSnapshot.data! |
|
|
|
final matchingDownloadTasks = downloadTasksSnapshot.requireData |
|
|
|
.where((final task) => _pathMatchesFile(task.path, file.name)); |
|
|
|
.where((final task) => _pathMatchesFile(task.path, file.name)); |
|
|
|
|
|
|
|
|
|
|
|
return StreamBuilder<int?>( |
|
|
|
return StreamBuilder<int?>( |
|
|
@ -165,10 +165,10 @@ class _FilesBrowserViewState extends State<FilesBrowserView> { |
|
|
|
widget.bloc.setPath([]); |
|
|
|
widget.bloc.setPath([]); |
|
|
|
}, |
|
|
|
}, |
|
|
|
), |
|
|
|
), |
|
|
|
for (var i = 0; i < pathSnapshot.data!.length; i++) ...[ |
|
|
|
for (var i = 0; i < pathSnapshot.requireData.length; i++) ...[ |
|
|
|
Builder( |
|
|
|
Builder( |
|
|
|
builder: (final context) { |
|
|
|
builder: (final context) { |
|
|
|
final path = pathSnapshot.data!.sublist(0, i + 1); |
|
|
|
final path = pathSnapshot.requireData.sublist(0, i + 1); |
|
|
|
return Tooltip( |
|
|
|
return Tooltip( |
|
|
|
message: AppLocalizations.of(context).goToPath(path.join('/')), |
|
|
|
message: AppLocalizations.of(context).goToPath(path.join('/')), |
|
|
|
excludeFromSemantics: true, |
|
|
|
excludeFromSemantics: true, |
|
|
@ -177,7 +177,7 @@ class _FilesBrowserViewState extends State<FilesBrowserView> { |
|
|
|
widget.bloc.setPath(path); |
|
|
|
widget.bloc.setPath(path); |
|
|
|
}, |
|
|
|
}, |
|
|
|
child: Text( |
|
|
|
child: Text( |
|
|
|
pathSnapshot.data![i], |
|
|
|
pathSnapshot.requireData[i], |
|
|
|
semanticsLabel: AppLocalizations.of(context).goToPath(path.join('/')), |
|
|
|
semanticsLabel: AppLocalizations.of(context).goToPath(path.join('/')), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|