Some another fixes for Android. Never ask us about that.

This commit is contained in:
M
2021-01-28 19:58:17 +02:00
parent 0774ce18ca
commit 5631961e47
7 changed files with 57 additions and 25 deletions
+10
View File
@@ -1,3 +1,5 @@
import 'dart:io';
import 'package:cake_wallet/core/backup_service.dart';
import 'package:cake_wallet/core/execution_state.dart';
import 'package:cake_wallet/entities/secret_store_key.dart';
@@ -66,4 +68,12 @@ abstract class BackupViewModelBase with Store {
@action
void showMasterPassword() => isBackupPasswordVisible = true;
@action
Future<void> saveToDownload(String name, List<int> content) async {
const downloadDirPath = '/storage/emulated/0/Download'; // For Android
final filePath = '$downloadDirPath/${name}';
final file = File(filePath);
await file.writeAsBytes(content);
}
}