mirror of
https://github.com/revanced/revanced-manager.git
synced 2025-06-13 04:57:37 +02:00
fix: rename PatcherService to PatcherAPI.
This commit is contained in:
@ -13,6 +13,6 @@ import 'package:stacked_services/stacked_services.dart';
|
|||||||
MaterialRoute(page: PatchesSelectorView),
|
MaterialRoute(page: PatchesSelectorView),
|
||||||
], dependencies: [
|
], dependencies: [
|
||||||
LazySingleton(classType: NavigationService),
|
LazySingleton(classType: NavigationService),
|
||||||
LazySingleton(classType: PatcherService),
|
LazySingleton(classType: PatcherAPI),
|
||||||
])
|
])
|
||||||
class AppSetup {}
|
class AppSetup {}
|
||||||
|
@ -26,7 +26,7 @@ Future<void> setupLocator(
|
|||||||
|
|
||||||
// Register dependencies
|
// Register dependencies
|
||||||
locator.registerLazySingleton(() => NavigationService());
|
locator.registerLazySingleton(() => NavigationService());
|
||||||
locator.registerLazySingleton(() => PatcherService());
|
locator.registerLazySingleton(() => PatcherAPI());
|
||||||
locator.registerLazySingleton(() => PatcherViewModel());
|
locator.registerLazySingleton(() => PatcherViewModel());
|
||||||
locator.registerLazySingleton(() => AppSelectorViewModel());
|
locator.registerLazySingleton(() => AppSelectorViewModel());
|
||||||
locator.registerLazySingleton(() => PatchesSelectorViewModel());
|
locator.registerLazySingleton(() => PatchesSelectorViewModel());
|
||||||
|
@ -9,7 +9,7 @@ import 'package:revanced_manager/services/github_api.dart';
|
|||||||
import 'package:revanced_manager/utils/string.dart';
|
import 'package:revanced_manager/utils/string.dart';
|
||||||
|
|
||||||
@lazySingleton
|
@lazySingleton
|
||||||
class PatcherService {
|
class PatcherAPI {
|
||||||
final GithubAPI githubAPI = GithubAPI();
|
final GithubAPI githubAPI = GithubAPI();
|
||||||
final List<AppInfo> _filteredPackages = [];
|
final List<AppInfo> _filteredPackages = [];
|
||||||
final Map<String, List<Patch>> _filteredPatches = <String, List<Patch>>{};
|
final Map<String, List<Patch>> _filteredPatches = <String, List<Patch>>{};
|
||||||
|
@ -5,7 +5,7 @@ import 'package:revanced_manager/ui/views/patcher/patcher_viewmodel.dart';
|
|||||||
import 'package:stacked/stacked.dart';
|
import 'package:stacked/stacked.dart';
|
||||||
|
|
||||||
class AppSelectorViewModel extends BaseViewModel {
|
class AppSelectorViewModel extends BaseViewModel {
|
||||||
final PatcherService patcherService = locator<PatcherService>();
|
final PatcherAPI patcherAPI = locator<PatcherAPI>();
|
||||||
List<AppInfo> apps = [];
|
List<AppInfo> apps = [];
|
||||||
AppInfo? selectedApp;
|
AppInfo? selectedApp;
|
||||||
|
|
||||||
@ -15,8 +15,8 @@ class AppSelectorViewModel extends BaseViewModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<void> getApps() async {
|
Future<void> getApps() async {
|
||||||
await patcherService.loadPatches();
|
await patcherAPI.loadPatches();
|
||||||
apps = await patcherService.getFilteredInstalledApps();
|
apps = await patcherAPI.getFilteredInstalledApps();
|
||||||
}
|
}
|
||||||
|
|
||||||
void selectApp(AppInfo appInfo) {
|
void selectApp(AppInfo appInfo) {
|
||||||
|
@ -6,7 +6,7 @@ import 'package:revanced_manager/ui/views/app_selector/app_selector_viewmodel.da
|
|||||||
import 'package:stacked/stacked.dart';
|
import 'package:stacked/stacked.dart';
|
||||||
|
|
||||||
class PatchesSelectorViewModel extends BaseViewModel {
|
class PatchesSelectorViewModel extends BaseViewModel {
|
||||||
final PatcherService patcherService = locator<PatcherService>();
|
final PatcherAPI patcherAPI = locator<PatcherAPI>();
|
||||||
List<Patch>? patches = [];
|
List<Patch>? patches = [];
|
||||||
List<Patch> selectedPatches = [];
|
List<Patch> selectedPatches = [];
|
||||||
|
|
||||||
@ -17,7 +17,7 @@ class PatchesSelectorViewModel extends BaseViewModel {
|
|||||||
|
|
||||||
Future<void> getPatches() async {
|
Future<void> getPatches() async {
|
||||||
AppInfo? appInfo = locator<AppSelectorViewModel>().selectedApp;
|
AppInfo? appInfo = locator<AppSelectorViewModel>().selectedApp;
|
||||||
patches = await patcherService.getFilteredPatches(appInfo);
|
patches = await patcherAPI.getFilteredPatches(appInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
void selectPatches(List<Patch> patches) {}
|
void selectPatches(List<Patch> patches) {}
|
||||||
|
@ -13,7 +13,7 @@ class AppSelectorCard extends StatelessWidget {
|
|||||||
this.onPressed,
|
this.onPressed,
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
|
|
||||||
final PatcherService patcherService = locator<PatcherService>();
|
final PatcherAPI patcherAPI = locator<PatcherAPI>();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
Reference in New Issue
Block a user