|  |  |  | @ -80,68 +80,17 @@ class _FilesBrowserViewState extends State<FilesBrowserView> { | 
			
		
	
		
			
				
					|  |  |  |  |                                   child: const Icon(Icons.add), | 
			
		
	
		
			
				
					|  |  |  |  |                                 ) | 
			
		
	
		
			
				
					|  |  |  |  |                               : null, | 
			
		
	
		
			
				
					|  |  |  |  |                           body: RefreshIndicator( | 
			
		
	
		
			
				
					|  |  |  |  |                             onRefresh: () async { | 
			
		
	
		
			
				
					|  |  |  |  |                               widget.bloc.refresh(); | 
			
		
	
		
			
				
					|  |  |  |  |                             }, | 
			
		
	
		
			
				
					|  |  |  |  |                             child: Column( | 
			
		
	
		
			
				
					|  |  |  |  |                               children: [ | 
			
		
	
		
			
				
					|  |  |  |  |                                 ExceptionWidget( | 
			
		
	
		
			
				
					|  |  |  |  |                                   filesError, | 
			
		
	
		
			
				
					|  |  |  |  |                                   onRetry: () { | 
			
		
	
		
			
				
					|  |  |  |  |                                     widget.bloc.refresh(); | 
			
		
	
		
			
				
					|  |  |  |  |                                   }, | 
			
		
	
		
			
				
					|  |  |  |  |                                 ), | 
			
		
	
		
			
				
					|  |  |  |  |                                 CustomLinearProgressIndicator( | 
			
		
	
		
			
				
					|  |  |  |  |                                   visible: filesLoading, | 
			
		
	
		
			
				
					|  |  |  |  |                                 ), | 
			
		
	
		
			
				
					|  |  |  |  |                                 Align( | 
			
		
	
		
			
				
					|  |  |  |  |                                   alignment: Alignment.topLeft, | 
			
		
	
		
			
				
					|  |  |  |  |                                   child: Container( | 
			
		
	
		
			
				
					|  |  |  |  |                                     margin: const EdgeInsets.symmetric( | 
			
		
	
		
			
				
					|  |  |  |  |                                       horizontal: 10, | 
			
		
	
		
			
				
					|  |  |  |  |                                     ), | 
			
		
	
		
			
				
					|  |  |  |  |                                     child: Wrap( | 
			
		
	
		
			
				
					|  |  |  |  |                                       crossAxisAlignment: WrapCrossAlignment.center, | 
			
		
	
		
			
				
					|  |  |  |  |                                       children: <Widget>[ | 
			
		
	
		
			
				
					|  |  |  |  |                                         SizedBox( | 
			
		
	
		
			
				
					|  |  |  |  |                                           height: 40, | 
			
		
	
		
			
				
					|  |  |  |  |                                           child: InkWell( | 
			
		
	
		
			
				
					|  |  |  |  |                                             onTap: () { | 
			
		
	
		
			
				
					|  |  |  |  |                                               widget.bloc.setPath([]); | 
			
		
	
		
			
				
					|  |  |  |  |                                             }, | 
			
		
	
		
			
				
					|  |  |  |  |                                             child: const Icon(Icons.house), | 
			
		
	
		
			
				
					|  |  |  |  |                                           ), | 
			
		
	
		
			
				
					|  |  |  |  |                                         ), | 
			
		
	
		
			
				
					|  |  |  |  |                                         for (var i = 0; i < pathSnapshot.data!.length; i++) ...[ | 
			
		
	
		
			
				
					|  |  |  |  |                                           InkWell( | 
			
		
	
		
			
				
					|  |  |  |  |                                             onTap: () { | 
			
		
	
		
			
				
					|  |  |  |  |                                               widget.bloc.setPath(pathSnapshot.data!.sublist(0, i + 1)); | 
			
		
	
		
			
				
					|  |  |  |  |                                             }, | 
			
		
	
		
			
				
					|  |  |  |  |                                             child: Text(pathSnapshot.data![i]), | 
			
		
	
		
			
				
					|  |  |  |  |                                           ), | 
			
		
	
		
			
				
					|  |  |  |  |                                         ], | 
			
		
	
		
			
				
					|  |  |  |  |                                       ] | 
			
		
	
		
			
				
					|  |  |  |  |                                           .intersperse( | 
			
		
	
		
			
				
					|  |  |  |  |                                             const Icon( | 
			
		
	
		
			
				
					|  |  |  |  |                                               Icons.keyboard_arrow_right, | 
			
		
	
		
			
				
					|  |  |  |  |                                               size: 40, | 
			
		
	
		
			
				
					|  |  |  |  |                                             ), | 
			
		
	
		
			
				
					|  |  |  |  |                                           ) | 
			
		
	
		
			
				
					|  |  |  |  |                                           .toList(), | 
			
		
	
		
			
				
					|  |  |  |  |                                     ), | 
			
		
	
		
			
				
					|  |  |  |  |                                   ), | 
			
		
	
		
			
				
					|  |  |  |  |                                 ), | 
			
		
	
		
			
				
					|  |  |  |  |                                 if (filesData != null) ...[ | 
			
		
	
		
			
				
					|  |  |  |  |                                   Builder( | 
			
		
	
		
			
				
					|  |  |  |  |                                     builder: (final context) { | 
			
		
	
		
			
				
					|  |  |  |  |                                       final uploadTasksWithoutExistingFile = uploadTasksSnapshot.data!.where( | 
			
		
	
		
			
				
					|  |  |  |  |                           body: CustomListView<Widget>( | 
			
		
	
		
			
				
					|  |  |  |  |                             scrollKey: 'files-${pathSnapshot.data!.join('/')}', | 
			
		
	
		
			
				
					|  |  |  |  |                             withFloatingActionButton: true, | 
			
		
	
		
			
				
					|  |  |  |  |                             items: [ | 
			
		
	
		
			
				
					|  |  |  |  |                               for (final uploadTask in filesData == null | 
			
		
	
		
			
				
					|  |  |  |  |                                   ? <UploadTask>[] | 
			
		
	
		
			
				
					|  |  |  |  |                                   : uploadTasksSnapshot.data!.where( | 
			
		
	
		
			
				
					|  |  |  |  |                                       (final task) => filesData | 
			
		
	
		
			
				
					|  |  |  |  |                                           .where((final file) => _pathMatchesFile(task.path, file.name)) | 
			
		
	
		
			
				
					|  |  |  |  |                                           .isEmpty, | 
			
		
	
		
			
				
					|  |  |  |  |                                       ); | 
			
		
	
		
			
				
					|  |  |  |  |                                       final widgets = [ | 
			
		
	
		
			
				
					|  |  |  |  |                                         for (final uploadTask in uploadTasksWithoutExistingFile) ...[ | 
			
		
	
		
			
				
					|  |  |  |  |                                     )) ...[ | 
			
		
	
		
			
				
					|  |  |  |  |                                 StreamBuilder<int>( | 
			
		
	
		
			
				
					|  |  |  |  |                                   stream: uploadTask.progress, | 
			
		
	
		
			
				
					|  |  |  |  |                                   builder: (final context, final uploadTaskProgressSnapshot) => | 
			
		
	
	
		
			
				
					|  |  |  | @ -164,6 +113,7 @@ class _FilesBrowserViewState extends State<FilesBrowserView> { | 
			
		
	
		
			
				
					|  |  |  |  |                                             ), | 
			
		
	
		
			
				
					|  |  |  |  |                                 ), | 
			
		
	
		
			
				
					|  |  |  |  |                               ], | 
			
		
	
		
			
				
					|  |  |  |  |                               if (filesData != null) ...[ | 
			
		
	
		
			
				
					|  |  |  |  |                                 for (final file in filesData) ...[ | 
			
		
	
		
			
				
					|  |  |  |  |                                   if (!widget.onlyShowDirectories || file.isDirectory) ...[ | 
			
		
	
		
			
				
					|  |  |  |  |                                     Builder( | 
			
		
	
	
		
			
				
					|  |  |  | @ -182,8 +132,7 @@ class _FilesBrowserViewState extends State<FilesBrowserView> { | 
			
		
	
		
			
				
					|  |  |  |  |                                             stream: matchingDownloadTasks.isNotEmpty | 
			
		
	
		
			
				
					|  |  |  |  |                                                 ? matchingDownloadTasks.first.progress | 
			
		
	
		
			
				
					|  |  |  |  |                                                 : Stream.value(null), | 
			
		
	
		
			
				
					|  |  |  |  |                                                     builder: (final context, final downloadTaskProgressSnapshot) => | 
			
		
	
		
			
				
					|  |  |  |  |                                                         _buildFile( | 
			
		
	
		
			
				
					|  |  |  |  |                                             builder: (final context, final downloadTaskProgressSnapshot) => _buildFile( | 
			
		
	
		
			
				
					|  |  |  |  |                                               context: context, | 
			
		
	
		
			
				
					|  |  |  |  |                                               details: FileDetails( | 
			
		
	
		
			
				
					|  |  |  |  |                                                 path: [...widget.bloc.path.value, file.name], | 
			
		
	
	
		
			
				
					|  |  |  | @ -196,10 +145,8 @@ class _FilesBrowserViewState extends State<FilesBrowserView> { | 
			
		
	
		
			
				
					|  |  |  |  |                                                 lastModified: matchingUploadTasks.isNotEmpty | 
			
		
	
		
			
				
					|  |  |  |  |                                                     ? matchingUploadTasks.first.lastModified | 
			
		
	
		
			
				
					|  |  |  |  |                                                     : file.lastModified!, | 
			
		
	
		
			
				
					|  |  |  |  |                                                         hasPreview: | 
			
		
	
		
			
				
					|  |  |  |  |                                                             matchingUploadTasks.isNotEmpty ? null : file.hasPreview, | 
			
		
	
		
			
				
					|  |  |  |  |                                                         isFavorite: | 
			
		
	
		
			
				
					|  |  |  |  |                                                             matchingUploadTasks.isNotEmpty ? null : file.favorite, | 
			
		
	
		
			
				
					|  |  |  |  |                                                 hasPreview: matchingUploadTasks.isNotEmpty ? null : file.hasPreview, | 
			
		
	
		
			
				
					|  |  |  |  |                                                 isFavorite: matchingUploadTasks.isNotEmpty ? null : file.favorite, | 
			
		
	
		
			
				
					|  |  |  |  |                                               ), | 
			
		
	
		
			
				
					|  |  |  |  |                                               uploadProgress: uploadTaskProgressSnapshot.data, | 
			
		
	
		
			
				
					|  |  |  |  |                                               downloadProgress: downloadTaskProgressSnapshot.data, | 
			
		
	
	
		
			
				
					|  |  |  | @ -210,29 +157,58 @@ class _FilesBrowserViewState extends State<FilesBrowserView> { | 
			
		
	
		
			
				
					|  |  |  |  |                                     ), | 
			
		
	
		
			
				
					|  |  |  |  |                                   ], | 
			
		
	
		
			
				
					|  |  |  |  |                                 ], | 
			
		
	
		
			
				
					|  |  |  |  |                                       ]; | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |                                       return Expanded( | 
			
		
	
		
			
				
					|  |  |  |  |                                         child: CustomListView<Widget>( | 
			
		
	
		
			
				
					|  |  |  |  |                                           scrollKey: 'files-${pathSnapshot.data!.join('/')}', | 
			
		
	
		
			
				
					|  |  |  |  |                                           withFloatingActionButton: true, | 
			
		
	
		
			
				
					|  |  |  |  |                                           items: widgets, | 
			
		
	
		
			
				
					|  |  |  |  |                               ], | 
			
		
	
		
			
				
					|  |  |  |  |                             ], | 
			
		
	
		
			
				
					|  |  |  |  |                             isLoading: filesLoading, | 
			
		
	
		
			
				
					|  |  |  |  |                             error: filesError, | 
			
		
	
		
			
				
					|  |  |  |  |                             onRetry: () { | 
			
		
	
		
			
				
					|  |  |  |  |                               widget.bloc.refresh(); | 
			
		
	
		
			
				
					|  |  |  |  |                             }, | 
			
		
	
		
			
				
					|  |  |  |  |                             onRefresh: () async { | 
			
		
	
		
			
				
					|  |  |  |  |                               widget.bloc.refresh(); | 
			
		
	
		
			
				
					|  |  |  |  |                             }, | 
			
		
	
		
			
				
					|  |  |  |  |                             builder: (final context, final widget) => widget, | 
			
		
	
		
			
				
					|  |  |  |  |                             topScrollingChildren: [ | 
			
		
	
		
			
				
					|  |  |  |  |                               Align( | 
			
		
	
		
			
				
					|  |  |  |  |                                 alignment: Alignment.topLeft, | 
			
		
	
		
			
				
					|  |  |  |  |                                 child: Container( | 
			
		
	
		
			
				
					|  |  |  |  |                                   margin: const EdgeInsets.symmetric( | 
			
		
	
		
			
				
					|  |  |  |  |                                     horizontal: 10, | 
			
		
	
		
			
				
					|  |  |  |  |                                   ), | 
			
		
	
		
			
				
					|  |  |  |  |                                       ); | 
			
		
	
		
			
				
					|  |  |  |  |                                   child: Wrap( | 
			
		
	
		
			
				
					|  |  |  |  |                                     crossAxisAlignment: WrapCrossAlignment.center, | 
			
		
	
		
			
				
					|  |  |  |  |                                     children: <Widget>[ | 
			
		
	
		
			
				
					|  |  |  |  |                                       SizedBox( | 
			
		
	
		
			
				
					|  |  |  |  |                                         height: 40, | 
			
		
	
		
			
				
					|  |  |  |  |                                         child: InkWell( | 
			
		
	
		
			
				
					|  |  |  |  |                                           onTap: () { | 
			
		
	
		
			
				
					|  |  |  |  |                                             widget.bloc.setPath([]); | 
			
		
	
		
			
				
					|  |  |  |  |                                           }, | 
			
		
	
		
			
				
					|  |  |  |  |                                           child: const Icon(Icons.house), | 
			
		
	
		
			
				
					|  |  |  |  |                                         ), | 
			
		
	
		
			
				
					|  |  |  |  |                                       ), | 
			
		
	
		
			
				
					|  |  |  |  |                                       for (var i = 0; i < pathSnapshot.data!.length; i++) ...[ | 
			
		
	
		
			
				
					|  |  |  |  |                                         InkWell( | 
			
		
	
		
			
				
					|  |  |  |  |                                           onTap: () { | 
			
		
	
		
			
				
					|  |  |  |  |                                             widget.bloc.setPath(pathSnapshot.data!.sublist(0, i + 1)); | 
			
		
	
		
			
				
					|  |  |  |  |                                           }, | 
			
		
	
		
			
				
					|  |  |  |  |                                           child: Text(pathSnapshot.data![i]), | 
			
		
	
		
			
				
					|  |  |  |  |                                         ), | 
			
		
	
		
			
				
					|  |  |  |  |                                       ], | 
			
		
	
		
			
				
					|  |  |  |  |                                     ] | 
			
		
	
		
			
				
					|  |  |  |  |                                         .intersperse( | 
			
		
	
		
			
				
					|  |  |  |  |                                     const SizedBox( | 
			
		
	
		
			
				
					|  |  |  |  |                                       height: 10, | 
			
		
	
		
			
				
					|  |  |  |  |                                           const Icon( | 
			
		
	
		
			
				
					|  |  |  |  |                                             Icons.keyboard_arrow_right, | 
			
		
	
		
			
				
					|  |  |  |  |                                             size: 40, | 
			
		
	
		
			
				
					|  |  |  |  |                                           ), | 
			
		
	
		
			
				
					|  |  |  |  |                                         ) | 
			
		
	
		
			
				
					|  |  |  |  |                                         .toList(), | 
			
		
	
		
			
				
					|  |  |  |  |                                   ), | 
			
		
	
		
			
				
					|  |  |  |  |                                 ), | 
			
		
	
		
			
				
					|  |  |  |  |                               ), | 
			
		
	
		
			
				
					|  |  |  |  |                             ], | 
			
		
	
		
			
				
					|  |  |  |  |                           ), | 
			
		
	
		
			
				
					|  |  |  |  |                         ), | 
			
		
	
		
			
				
					|  |  |  |  |             ), | 
			
		
	
		
			
				
					|  |  |  |  |           ), | 
			
		
	
		
			
				
					|  |  |  |  |         ), | 
			
		
	
	
		
			
				
					|  |  |  | 
 |