feat: ability to store and load selected patches (#469)

* feat: ability to store and load selected patches

* fix: I18n

* fix: do not append but truncate file

* fix: use json file, minor fixes

* fix: better ui

* WIP

* feat: load patches selection after app selection

* feat: import/export json file

* fix: reformat code

* fix: rare bug on import feature fixed

* fix: move export/ipmort to settings page & import full json

* fix: minor improvements

* fix: minor code quality improvements

* fix: export filename fix

* fix: select list element istead of removing it
This commit is contained in:
Boris M
2022-11-09 08:36:04 +01:00
committed by GitHub
parent fd5d71e24d
commit c571cf2c53
8 changed files with 224 additions and 3 deletions

View File

@ -107,4 +107,15 @@ class PatcherViewModel extends BaseViewModel {
'appSelectorCard.recommendedVersion',
)}: $recommendedVersion';
}
Future<void> loadLastSelectedPatches() async {
this.selectedPatches.clear();
List<String> selectedPatches =
await _managerAPI.getSelectedPatches(selectedApp!.originalPackageName);
List<Patch> patches =
await _patcherAPI.getFilteredPatches(selectedApp!.originalPackageName);
this.selectedPatches
.addAll(patches.where((patch) => selectedPatches.contains(patch.name)));
notifyListeners();
}
}