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), MaterialRoute(page: PatchesSelectorView),
], dependencies: [ ], dependencies: [
LazySingleton(classType: NavigationService), LazySingleton(classType: NavigationService),
LazySingleton(classType: PatcherService), LazySingleton(classType: PatcherAPI),
]) ])
class AppSetup {} class AppSetup {}

View File

@ -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());

View File

@ -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>>{};

View File

@ -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) {

View File

@ -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) {}

View File

@ -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) {