feat(mobile): handle backup iCloud asset (#5508)

* feat(mobile): handle backup iCloud asset

* additional state

* Download progress

* Added a separate page for backup options

* handle ingore iCloud asset upload'

* fix init backup service

* PR feedback

* fix negative count

* get file title
This commit is contained in:
Alex 2023-12-07 09:53:15 -06:00 committed by GitHub
parent c25556bb08
commit 2e59b07cc6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 730 additions and 503 deletions

View file

@ -61,7 +61,9 @@ class BackupNotifier extends StateNotifier<BackUpState> {
fileCreatedAt: DateTime.parse('2020-10-04'),
fileName: '...',
fileType: '...',
iCloudAsset: false,
),
iCloudDownloadProgress: 0.0,
),
);
@ -444,9 +446,18 @@ class BackupNotifier extends StateNotifier<BackUpState> {
// Perform Backup
state = state.copyWith(cancelToken: CancellationToken());
final pmProgressHandler = PMProgressHandler();
pmProgressHandler.stream.listen((event) {
final double progress = event.progress;
state = state.copyWith(iCloudDownloadProgress: progress);
});
await _backupService.backupAsset(
assetsWillBeBackup,
state.cancelToken,
pmProgressHandler,
_onAssetUploaded,
_onUploadProgress,
_onSetCurrentBackupAsset,