Merge branch 'main' into spike/block2-derisking
# Conflicts: # apps/app_seeds/lib/app.dart # apps/app_seeds/lib/i18n/strings.g.dart # apps/app_seeds/lib/main.dart
This commit is contained in:
commit
cf99b7ff87
23 changed files with 607 additions and 25 deletions
|
|
@ -1,6 +1,7 @@
|
|||
import 'dart:io';
|
||||
|
||||
import 'package:commons_core/commons_core.dart';
|
||||
import 'package:flutter/foundation.dart' show kIsWeb;
|
||||
import 'package:flutter/services.dart' show rootBundle;
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:get_it/get_it.dart';
|
||||
|
|
@ -15,6 +16,8 @@ import '../db/encrypted_executor.dart';
|
|||
import '../i18n/strings.g.dart';
|
||||
import '../security/secret_store.dart';
|
||||
import '../security/secure_key_store.dart';
|
||||
import '../services/auto_backup_service.dart';
|
||||
import '../services/auto_backup_store.dart';
|
||||
import '../services/export_import_service.dart';
|
||||
import '../services/file_picker_file_service.dart';
|
||||
import '../services/file_service.dart';
|
||||
|
|
@ -100,6 +103,23 @@ Future<void> configureDependencies() async {
|
|||
..registerSingleton<RecoverySheetService>(
|
||||
RecoverySheetService(files: fileService),
|
||||
);
|
||||
|
||||
// Automatic silent backups need real file storage; the web build has none, so
|
||||
// it simply goes without (the manual "save a copy" still works there).
|
||||
if (!kIsWeb) {
|
||||
getIt.registerSingleton<AutoBackupService>(
|
||||
AutoBackupService(
|
||||
exporter: getIt<ExportImportService>(),
|
||||
store: AutoBackupStore(secretStore),
|
||||
directory: _backupsDir,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Future<Directory> _backupsDir() async {
|
||||
final dir = await getApplicationSupportDirectory();
|
||||
return Directory(p.join(dir.path, 'backups'));
|
||||
}
|
||||
|
||||
Future<File> _databaseFile() async {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue