mirror of
https://github.com/revanced/revanced-manager
synced 2024-05-14 13:56:57 +02:00
25 lines
822 B
Dart
25 lines
822 B
Dart
import 'package:installed_apps/app_info.dart';
|
|
import 'package:revanced_manager/app/app.locator.dart';
|
|
import 'package:revanced_manager/models/patch.dart';
|
|
import 'package:revanced_manager/services/patcher_api.dart';
|
|
import 'package:revanced_manager/ui/views/app_selector/app_selector_viewmodel.dart';
|
|
import 'package:stacked/stacked.dart';
|
|
|
|
class PatchesSelectorViewModel extends BaseViewModel {
|
|
final PatcherAPI patcherAPI = locator<PatcherAPI>();
|
|
List<Patch>? patches = [];
|
|
List<Patch> selectedPatches = [];
|
|
|
|
Future<void> initialise() async {
|
|
await getPatches();
|
|
notifyListeners();
|
|
}
|
|
|
|
Future<void> getPatches() async {
|
|
AppInfo? appInfo = locator<AppSelectorViewModel>().selectedApp;
|
|
patches = await patcherAPI.getFilteredPatches(appInfo);
|
|
}
|
|
|
|
void selectPatches(List<Patch> patches) {}
|
|
}
|