mirror of
https://github.com/ReVanced/revanced-manager.git
synced 2026-01-28 05:11:03 +00:00
feat: Add ReVanced API and implement cache on it and on Github API
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
// ignore: depend_on_referenced_packages
|
||||
import 'package:collection/collection.dart';
|
||||
import 'package:revanced_manager/app/app.locator.dart';
|
||||
import 'package:revanced_manager/models/patch.dart';
|
||||
import 'package:revanced_manager/models/patched_application.dart';
|
||||
@@ -71,9 +73,14 @@ class PatchesSelectorViewModel extends BaseViewModel {
|
||||
|
||||
List<String> getSupportedVersions(Patch patch) {
|
||||
PatchedApplication app = locator<PatcherViewModel>().selectedApp!;
|
||||
return patch.compatiblePackages
|
||||
.firstWhere((pack) => pack.name == app.packageName)
|
||||
.versions;
|
||||
Package? package = patch.compatiblePackages.firstWhereOrNull(
|
||||
(pack) => pack.name == app.packageName,
|
||||
);
|
||||
if (package != null) {
|
||||
return package.versions;
|
||||
} else {
|
||||
return List.empty();
|
||||
}
|
||||
}
|
||||
|
||||
bool isPatchSupported(Patch patch) {
|
||||
|
||||
Reference in New Issue
Block a user