make copy work, also some abstraction and new provider
This commit is contained in:
parent
a66ed70532
commit
869f2c14c3
6 changed files with 145 additions and 107 deletions
40
lib/providers/sftp_loading_provider.dart
Normal file
40
lib/providers/sftp_loading_provider.dart
Normal file
|
@ -0,0 +1,40 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
class SftpLoadingProvider extends ChangeNotifier {
|
||||
|
||||
double? _uploadProgress;
|
||||
double? _downloadProgress;
|
||||
|
||||
double? _copyProgress;
|
||||
List<String>? _toBeMovedOrCopied;
|
||||
bool _isCopy = false;
|
||||
|
||||
|
||||
double? get copyProgress => _copyProgress;
|
||||
double? get uploadProgress => _uploadProgress;
|
||||
double? get downloadProgress => _downloadProgress;
|
||||
|
||||
List<String>? get toBeMovedOrCopied => _toBeMovedOrCopied;
|
||||
bool get isCopy => _isCopy;
|
||||
|
||||
void setUploadProgress(double? progress) {
|
||||
_uploadProgress = progress;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setDownloadProgress(double? progress) {
|
||||
_downloadProgress = progress;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setCopyProgress(double? progress) {
|
||||
_copyProgress = progress;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setCopyOrMoveFiles(List<String>? files, bool isCopy) {
|
||||
_toBeMovedOrCopied = files;
|
||||
_isCopy = isCopy;
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue