select files feature and operations on them

This commit is contained in:
RafayAhmad7548 2025-08-19 15:45:31 +05:00
parent 7f3146d712
commit 99da431190
4 changed files with 85 additions and 30 deletions

View file

@ -22,6 +22,7 @@ class OperationButtons extends StatelessWidget {
children: [
IconButton(
onPressed: () {
sftpProvider.clearSelectedFiles();
final filePaths = dirEntries.map((dirEntry) => '${sftpProvider.path}${dirEntry.filename}').toList();
sftpLoadingProvider.setCopyOrMoveFiles(filePaths, false);
},
@ -29,6 +30,7 @@ class OperationButtons extends StatelessWidget {
),
IconButton(
onPressed: () {
sftpProvider.clearSelectedFiles();
final filePaths = dirEntries.map((dirEntry) => '${sftpProvider.path}${dirEntry.filename}').toList();
sftpLoadingProvider.setCopyOrMoveFiles(filePaths, true);
},
@ -105,11 +107,12 @@ class OperationButtons extends StatelessWidget {
ScaffoldMessenger.of(context).showSnackBar(buildErrorSnackBar(context, e.toString()));
}
}
sftpProvider.listDir();
if (context.mounted) {
Navigator.pop(context);
}
}
sftpProvider.listDir();
if (context.mounted) {
Navigator.pop(context);
}
sftpProvider.clearSelectedFiles();
},
child: Text('Yes')
),
@ -122,6 +125,7 @@ class OperationButtons extends StatelessWidget {
),
IconButton(
onPressed: () async {
sftpProvider.clearSelectedFiles();
final downloadsDir = await getDownloadsDirectory();
if (downloadsDir == null) return;
for (final dirEntry in dirEntries) {