fix: mark sftp mission as completed when dispose

This commit is contained in:
lollipopkit
2023-09-12 13:26:14 +08:00
parent 730a62831b
commit 700322c603
8 changed files with 56 additions and 37 deletions

View File

@@ -23,14 +23,14 @@ class SftpProvider extends ChangeNotifier {
@override
void dispose() {
for (final item in _status) {
item.worker.dispose();
item.dispose();
}
super.dispose();
}
void cancel(int id) {
final idx = _status.indexWhere((element) => element.id == id);
_status[idx].worker.dispose();
_status[idx].dispose();
_status.removeAt(idx);
notifyListeners();
}