fix: rename PatcherService to PatcherAPI.

This commit is contained in:
Alberto Ponces 2022-08-09 01:20:50 +01:00
parent 33fb2a81b5
commit 7c7a7e0355
6 changed files with 9 additions and 9 deletions

View file

@ -13,6 +13,6 @@ import 'package:stacked_services/stacked_services.dart';
MaterialRoute(page: PatchesSelectorView),
], dependencies: [
LazySingleton(classType: NavigationService),
LazySingleton(classType: PatcherService),
LazySingleton(classType: PatcherAPI),
])
class AppSetup {}

View file

@ -26,7 +26,7 @@ Future<void> setupLocator(
// Register dependencies
locator.registerLazySingleton(() => NavigationService());
locator.registerLazySingleton(() => PatcherService());
locator.registerLazySingleton(() => PatcherAPI());
locator.registerLazySingleton(() => PatcherViewModel());
locator.registerLazySingleton(() => AppSelectorViewModel());
locator.registerLazySingleton(() => PatchesSelectorViewModel());

View file

@ -9,7 +9,7 @@ import 'package:revanced_manager/services/github_api.dart';
import 'package:revanced_manager/utils/string.dart';
@lazySingleton
class PatcherService {
class PatcherAPI {
final GithubAPI githubAPI = GithubAPI();
final List<AppInfo> _filteredPackages = [];
final Map<String, List<Patch>> _filteredPatches = <String, List<Patch>>{};

View file

@ -5,7 +5,7 @@ import 'package:revanced_manager/ui/views/patcher/patcher_viewmodel.dart';
import 'package:stacked/stacked.dart';
class AppSelectorViewModel extends BaseViewModel {
final PatcherService patcherService = locator<PatcherService>();
final PatcherAPI patcherAPI = locator<PatcherAPI>();
List<AppInfo> apps = [];
AppInfo? selectedApp;
@ -15,8 +15,8 @@ class AppSelectorViewModel extends BaseViewModel {
}
Future<void> getApps() async {
await patcherService.loadPatches();
apps = await patcherService.getFilteredInstalledApps();
await patcherAPI.loadPatches();
apps = await patcherAPI.getFilteredInstalledApps();
}
void selectApp(AppInfo appInfo) {

View file

@ -6,7 +6,7 @@ import 'package:revanced_manager/ui/views/app_selector/app_selector_viewmodel.da
import 'package:stacked/stacked.dart';
class PatchesSelectorViewModel extends BaseViewModel {
final PatcherService patcherService = locator<PatcherService>();
final PatcherAPI patcherAPI = locator<PatcherAPI>();
List<Patch>? patches = [];
List<Patch> selectedPatches = [];
@ -17,7 +17,7 @@ class PatchesSelectorViewModel extends BaseViewModel {
Future<void> getPatches() async {
AppInfo? appInfo = locator<AppSelectorViewModel>().selectedApp;
patches = await patcherService.getFilteredPatches(appInfo);
patches = await patcherAPI.getFilteredPatches(appInfo);
}
void selectPatches(List<Patch> patches) {}

View file

@ -13,7 +13,7 @@ class AppSelectorCard extends StatelessWidget {
this.onPressed,
}) : super(key: key);
final PatcherService patcherService = locator<PatcherService>();
final PatcherAPI patcherAPI = locator<PatcherAPI>();
@override
Widget build(BuildContext context) {